Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6430 in orxonox.OLD for trunk/src/world_entities/world_entity.h


Ignore:
Timestamp:
Jan 8, 2006, 12:14:49 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Energy System on WorldEntity-level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/world_entity.h

    r6424 r6430  
    2020class BVTree;
    2121class Model;
     22class GLGuiBar;
    2223
    2324//class CharacterAttributes;
     
    2728class WorldEntity : public PNode, public Synchronizeable
    2829{
    29  public:
    30   WorldEntity(const TiXmlElement* root = NULL);
     30public:
     31  WorldEntity();
    3132  virtual ~WorldEntity ();
    3233
     
    3536  void loadModel(const char* fileName, float scaling = 1.0f, unsigned int modelNumber = 0);
    3637  void setModel(Model* model, unsigned int modelNumber = 0);
    37   Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
     38Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
    3839
    3940  inline void loadMD2Texture(const char* fileName) { this->md2TextureFileName = fileName; }
     
    6162
    6263
    63   void debugWE() { this->debugEntity(); };  ///FIXME
     64  void debugWE() { this->debugEntity(); }
     65  ;  ///FIXME
    6466  void debugEntity() const;
    6567
     
    8284  int       readState(byte* data, int maxLength );
    8385
    84  protected:
    85   //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
     86  /** @returns the Energy of the entity */
     87  float getEnergy() const { return this->energy; };
     88  /** @returns the Maximum energy this entity can be charged with */
     89  float getMaxEnergy() const { return this->energyMax; }
     90  float addEnergy(float energy);
     91  float removeEnergy(float energy);
     92  void setMaxEnergy(float maxEnergy);
    8693
    8794
    88  private:
     95protected:
     96  void setEnergy(float energy) { this->energy = energy; };
     97  void setEnergyWidgetVisibilit(bool visibility);
     98  void createEnergyWidget();
     99  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
     100private:
     101  void updateEnergyWidget();
     102
     103private:
     104  /// TODO maybe we will move the following three entries and the corresponding functions to Playable AND NPC
     105  float                   energy;             //!< The Energy of this Entity, if the Entity has any energy at all.
     106  float                   energyMax;          //!< The Maximal energy this entity can take.
     107  GLGuiBar*               energyWidget;       //!< The Slider (if wanted).
     108
    89109  std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
    90110  const char*             md2TextureFileName; //!< the file name of the md2 model texture, only if this
Note: See TracChangeset for help on using the changeset viewer.