Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9513 in orxonox.OLD


Ignore:
Timestamp:
Jul 27, 2006, 5:38:53 PM (18 years ago)
Author:
bensch
Message:

toList editable

Location:
branches/proxy/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/server_socket.h

    r7954 r9513  
    11/*!
    22 * @file server_socket.h
    3  *  waits for incoming connections
    4 
     3 * waits for incoming connections and handles them.
     4 *
    55 */
    66
  • branches/proxy/src/util/object_manager.cc

    r9406 r9513  
    134134  if (omList != OM_INIT || omList == OM_SIZE)
    135135  {
    136     PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList), this->objectLists[omList].size());
     136    PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->objectLists[omList].size());
    137137  //  if (level >= 1)
    138138    {
     
    174174 * @returns the String transformed from omList.
    175175 */
    176 const char* ObjectManager::OMListToString(OM_LIST omList)
     176const std::string& ObjectManager::OMListToString(OM_LIST omList)
    177177{
    178178  if (omList == OM_INIT || omList == OM_SIZE)
    179     return "===invalid===";
     179    return ObjectManager::objectManagerListNames[0];
    180180
    181181  printf("%d\n", omList);
     
    199199    }
    200200  }
    201   return OM_DEFAULT_LIST;
    202 }
    203 
    204 
    205 
    206 const char* ObjectManager::objectManagerListNames[] = {
     201  return OM_NULL;
     202}
     203
     204
     205
     206const std::string ObjectManager::objectManagerListNames[] = {
    207207    "null",
    208208    "dead",
  • branches/proxy/src/util/object_manager.h

    r8068 r9513  
    9696
    9797  static OM_LIST StringToOMList(const std::string& listName);
    98   static const char* OMListToString(OM_LIST omList);
     98  static const std::string& OMListToString(OM_LIST omList);
    9999
    100100
     
    113113  EntityList                              objectLists[OM_SIZE];     //!< The ObjectLists.
    114114
    115   static const char*                      objectManagerListNames[]; //!< Names of all the lists
     115  static const std::string                objectManagerListNames[]; //!< Names of all the lists
    116116
    117117  EntityList                              reflectionList;           //!< A list of all reflected objects in the world
  • branches/proxy/src/world_entities/npcs/ground_turret.cc

    r9406 r9513  
    8080
    8181/**
    82  * loads a GroundTurret from a XML-element
     82 * @brief loads a GroundTurret from a XML-element
    8383 * @param root the XML-element to load from
    8484 * @todo make the class Loadable
  • branches/proxy/src/world_entities/weapons/aim.h

    r7221 r9513  
    3737
    3838  inline void selectTarget(PNode* target) { this->setParent(target); };
    39   inline PNode* getTarget(PNode* target) { return this->getParent(); };
     39  inline PNode* getTarget(PNode* target) const { return this->getParent(); };
    4040
    4141  void searchTarget();
    4242
    43   void setRange(float range){this->range = range;};
    44   void setAngle(float angle){this->angle = angle;};
    45   void setGroup(OM_LIST group){this->group = group;};
     43  void setRange(float range) {this->range = range;};
     44  void setAngle(float angle) {this->angle = angle;};
     45  void setGroup(OM_LIST group) {this->group = group;};
    4646
    4747  void setSize(float size);
  • branches/proxy/src/world_entities/world_entity.cc

    r9494 r9513  
    141141  .describe("The Health the WorldEntity has at this moment")
    142142  .defaultValues(1.0f);
     143
     144  LoadParam(root, "list", this, WorldEntity, toListS);
    143145}
    144146
     
    478480}
    479481
     482void WorldEntity::toListS(const std::string& listName)
     483{
     484  OM_LIST id = ObjectManager::StringToOMList(listName);
     485  if (id != OM_NULL)
     486    this->toList(id);
     487  else
     488    PRINTF(2)("List %s not found\n", listName.c_str());
     489}
     490
     491
    480492void WorldEntity::toReflectionList()
    481493{
     
    822834  PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassCName(), this->getCName());
    823835  this->debugNode();
    824   PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size());
     836  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber).c_str(), this->models.size());
    825837  for (unsigned int i = 0; i < this->models.size(); i++)
    826838  {
  • branches/proxy/src/world_entities/world_entity.h

    r9298 r9513  
    115115  /* --- Object Manager Block --- */
    116116  void toList(OM_LIST list);
     117  void toListS(const std::string& listName);
    117118
    118119  void toReflectionList();
Note: See TracChangeset for help on using the changeset viewer.