Changeset 9610 in orxonox.OLD for branches/proxy/src/world_entities/npcs
- Timestamp:
- Jul 30, 2006, 11:33:31 AM (18 years ago)
- Location:
- branches/proxy/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/world_entities/npcs/network_turret.cc
r9609 r9610 80 80 this->weaponHolder.setRelCoor(0,25,0); 81 81 this->weaponHolder.setParent(this); 82 83 this->targetGroup_handle = this->registerVarId( new SynchronizeableInt ( &targetGroup, &targetGroup_write, "targetgroup" ) ); 82 84 } 83 85 … … 92 94 // all the clases this Entity is directly derived from must be called in this way, to load all settings. 93 95 NPC::loadParams(root); 96 97 LoadParam(root, "target-group", this, NetworkTurret, setTargetGroupS); 94 98 } 95 99 … … 122 126 } 123 127 128 void NetworkTurret::setTargetGroup(int targetGroup) 129 { 130 this->weapon->setTargetGroup((OM_LIST)targetGroup); 131 } 124 132 133 134 void NetworkTurret::setTargetGroupS(const std::string& groupName) 135 { 136 OM_LIST id = ObjectManager::StringToOMList(groupName); 137 if (id != OM_NULL) 138 this->setTargetGroup(id); 139 else 140 PRINTF(2)("List %s not found for targetting\n", groupName.c_str()); 141 } 142 143 void NetworkTurret::varChangeHandler( std::list< int > & id ) 144 { 145 WorldEntity::varChangeHandler( id ); 146 147 if ( std::find( id.begin(), id.end(), targetGroup_handle) != id.end() ) 148 { 149 setTargetGroup( targetGroup_write ); 150 } 151 } 125 152 126 153 /** -
branches/proxy/src/world_entities/npcs/network_turret.h
r9608 r9610 9 9 #include "npcs/npc.h" 10 10 11 class Weapon;11 class TargetingTurret; 12 12 13 13 //! A Class to ... … … 24 24 virtual void leftWorld (); 25 25 26 26 27 virtual void destroy(WorldEntity* killer); 27 28 28 29 virtual void draw() const; 29 30 virtual void tick(float time); 31 32 33 void setTargetGroup(int targetGroup); 34 void setTargetGroupS(const std::string& targetGroup); 35 36 virtual void varChangeHandler( std::list<int> & id ); 37 30 38 31 39 private: … … 34 42 private: 35 43 PNode weaponHolder; 36 Weapon *weapon; 44 TargetingTurret *weapon; 45 46 int targetGroup; 47 int targetGroup_write; 48 49 int targetGroup_handle; 37 50 }; 38 51
Note: See TracChangeset
for help on using the changeset viewer.