Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9718 in orxonox.OLD for branches/new_class_id/src/lib/util


Ignore:
Timestamp:
Sep 1, 2006, 11:56:54 PM (18 years ago)
Author:
bensch
Message:

more thoughts on Resources, and soon going to adapt… i think i've got a clue :)

Location:
branches/new_class_id/src/lib/util/loading
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9406 r9718  
    1818#include "resource.h"
    1919
    20 
     20ObjectListDefinition(Resource);
    2121
    2222
     
    2626Resource::Resource (const std::string& fileName)
    2727{
    28 //   this->setClassID(CL_RESOURCE, "Resource");
     28  this->registerObject(this, Resource::_objectList);
    2929
    3030}
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9715 r9718  
    1919class Resource : virtual public BaseObject
    2020{
     21  ObjectListDeclaration(Resource);
    2122public:
    22   class Priority
     23  class KeepLevel
    2324  {
    2425  public:
    25     void setPriorityName(unsigned int level, const std::string& name)
     26    void setKeepLevelName(unsigned int level, const std::string& name)
    2627    {
    27       if (_priorityName.size() <= level)
    28         _priorityName.resize(level+1);
    29       _priorityName[level] = name;
     28      if (_keepLevelName.size() <= level)
     29        _keepLevelName.resize(level+1);
     30      _keepLevelName[level] = name;
    3031    }
    3132  private:
    32     std::vector<std::string>     _priorityName;
     33    std::vector<std::string>     _keepLevelName;
    3334  };
    3435
     
    4647    std::vector<std::string>      _resourceSubPaths;
    4748    std::vector<std::string>      _fileExtensions;
    48 
    4949  };
    50 
    5150
    5251public:
     
    6059
    6160private:
     61  std::string              _fileName;
     62  MultiType                _parameters[3];          //!< The Parameters given to this Resource.
     63  Resource::KeepLevel      _keepLevel;              //!< The Priority of this resource. (can only be increased, so noone else will delete this)
    6264
    63   static std::vector<std::vector<std::string> >     _resourcePaths;
    6465
    65   static std::vector<std::string>                   _resourceClassNames;
     66  static std::vector<Resource::Type>     _resourceTypes;
    6667
    6768  //! GLOBALS
    68   static std::string                                _mainGlobalPath;
    69   static std::vector<std::string>                   _globalPaths;
    70 
    71   std::string       fileName;
    72 
    73   unsigned int      referenceCount;    //!< How many times this Resource has been loaded.
    74   /// TODO REMOVE THIS:   ResourceType      type;              //!< ResourceType of this Resource.
    75   Resource::Priority  prio;              //!< The Priority of this resource. (can only be increased, so noone else will delete this)
    76 
    77   MultiType         param[3];          //!< The Parameters given to this Resource.
     69  static std::string                     _mainGlobalPath;
     70  static std::vector<std::string>        _globalPaths;
    7871};
    7972
Note: See TracChangeset for help on using the changeset viewer.