Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7216 in orxonox.OLD for branches/std/src/world_entities/power_ups


Ignore:
Timestamp:
Mar 12, 2006, 8:54:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/std:: compile and run again, with many more std::strings….

Location:
branches/std/src/world_entities/power_ups
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/world_entities/power_ups/param_power_up.cc

    r7193 r7216  
    8181}
    8282
    83 void ParamPowerUp::setType(const char* type)
     83void ParamPowerUp::setType(const std::string& type)
    8484{
    8585  for(int i = 0; i < POWERUP_PARAM_size; ++i) {
    86     if(strcmp(type, paramTypes[i]) == 0) {
     86    if(type == paramTypes[i]) {
    8787      this->type = (EnumParamPowerUpType)i;
    8888      break;
  • branches/std/src/world_entities/power_ups/param_power_up.h

    r7065 r7216  
    2828  void setMaxValue(float value);
    2929  void setMinValue(float value);
    30   void setType(const char* type);
     30  void setType(const std::string& type);
    3131  EnumParamPowerUpType getType();
    3232  float getValue();
     
    4343
    4444private:
    45   static const char* paramTypes[];
    46   EnumParamPowerUpType type;
    47   float value;
    48   float max_value;
    49   float min_value;
     45  EnumParamPowerUpType    type;
     46  float                   value;
     47  float                   max_value;
     48  float                   min_value;
     49
     50  static const char*      paramTypes[];
     51
    5052};
    5153
  • branches/std/src/world_entities/power_ups/power_up.cc

    r7207 r7216  
    182182  };
    183183
    184 void PowerUp::setRespawnType(const char* type)
     184
     185void PowerUp::setRespawnType(const std::string& type)
    185186{
    186187  for(int i = 0; i < RESPAWN_size; ++i)
    187188  {
    188     if(!strcmp(type, respawnTypes[i]))
     189    if(type == respawnTypes[i])
    189190    {
    190191      this->respawnType = (PowerUpRespawn)i;
  • branches/std/src/world_entities/power_ups/power_up.h

    r7207 r7216  
    3131  virtual void draw () const;
    3232  virtual void tick(float dt);
    33   void setRespawnType(const char* type);
     33  void setRespawnType(const std::string& type);
    3434  void setRespawnTime(const float respawn);
    3535
     
    4545
    4646private:
    47   SoundSource    soundSource;
    48   SoundBuffer*   pickupBuffer;
    49   SoundBuffer*   respawnBuffer;
    50   Material* sphereMaterial;
    51   PowerUpRespawn respawnType;
    52   float respawnTime;
    53   float respawnStart;
    54   static const char* respawnTypes[];
     47  SoundSource         soundSource;
     48  SoundBuffer*        pickupBuffer;
     49  SoundBuffer*        respawnBuffer;
     50  Material*           sphereMaterial;
     51  PowerUpRespawn      respawnType;
     52  float               respawnTime;
     53  float               respawnStart;
     54  static const char*  respawnTypes[];
    5555
    56   WorldEntity* collider;
     56  WorldEntity*        collider;
    5757};
    5858
Note: See TracChangeset for help on using the changeset viewer.