- Timestamp:
- Feb 2, 2006, 4:09:46 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/network_game_manager.cc
r6959 r6985 701 701 PRINTF(0)("uniqueID = %d\n", s->getUniqueID()); 702 702 703 player->set Controllable(p);703 player->setPlayable(p); 704 704 705 705 -
trunk/src/story_entities/game_world_data.cc
r6984 r6985 230 230 { 231 231 playable = dynamic_cast<Playable*>(playableList->front()); 232 this->localPlayer->set Controllable(playable);232 this->localPlayer->setPlayable(playable); 233 233 } 234 234 -
trunk/src/story_entities/multi_player_world_data.cc
r6634 r6985 179 179 { 180 180 playable = dynamic_cast<Playable*>(playableList->front()); 181 this->localPlayer->set Controllable(playable);181 this->localPlayer->setPlayable(playable); 182 182 } 183 183 } … … 250 250 { 251 251 playable = dynamic_cast<Playable*>(playableList->front()); 252 this->localPlayer->disconnect Controllable();253 this->localPlayer->set Controllable(playable);252 this->localPlayer->disconnectPlayable(); 253 this->localPlayer->setPlayable(playable); 254 254 this->toggle = !this->toggle; 255 255 } … … 257 257 { 258 258 playable = dynamic_cast<Playable*>(playableList->back()); 259 this->localPlayer->disconnect Controllable();260 this->localPlayer->set Controllable(playable);259 this->localPlayer->disconnectPlayable(); 260 this->localPlayer->setPlayable(playable); 261 261 this->toggle = !this->toggle; 262 262 } 263 263 264 264 265 Playable* pl = this->localPlayer->get Controllable();265 Playable* pl = this->localPlayer->getPlayable(); 266 266 PRINTF(0)("The current regisered playable is hid: %i\n", pl->getUniqueID()); 267 267 -
trunk/src/world_entities/player.cc
r6700 r6985 37 37 PRINTF(4)("PLAYER INIT\n"); 38 38 39 this-> controllable = NULL;39 this->playable = NULL; 40 40 this->hud.show(); 41 41 … … 53 53 54 54 55 bool Player::set Controllable(Playable* controllable)55 bool Player::setPlayable(Playable* playable) 56 56 { 57 if( controllable != NULL && controllable->subscribePlayer(this))57 if(playable != NULL && playable->subscribePlayer(this)) 58 58 { 59 this-> controllable = controllable;60 this->hud.setEnergyWidget(this-> controllable->getHealthWidget());61 this->hud.setWeaponManager(this-> controllable->getWeaponManager());59 this->playable = playable; 60 this->hud.setEnergyWidget(this->playable->getHealthWidget()); 61 this->hud.setWeaponManager(this->playable->getWeaponManager()); 62 62 return true; 63 63 } … … 66 66 } 67 67 68 bool Player::disconnect Controllable()68 bool Player::disconnectPlayable() 69 69 { 70 if(this-> controllable == NULL) return true;70 if(this->playable == NULL) return true; 71 71 72 if(this-> controllable->unsubscribePlayer(this))72 if(this->playable->unsubscribePlayer(this)) 73 73 { 74 this-> controllable = NULL;74 this->playable = NULL; 75 75 this->hud.setEnergyWidget(NULL); 76 76 this->hud.setWeaponManager(NULL); … … 96 96 list<BaseObject*>::const_iterator node; 97 97 for (node = objectList->begin(); node != objectList->end(); node++) 98 if (this-> controllable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->controllable->getAbsCoor()).len() < 10.0)98 if (this->playable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < 10.0) 99 99 { 100 100 101 this->disconnect Controllable();102 this->set Controllable(dynamic_cast<Playable*>(*node));101 this->disconnectPlayable(); 102 this->setPlayable(dynamic_cast<Playable*>(*node)); 103 103 104 104 break; … … 107 107 } 108 108 109 if (likely(this-> controllable != NULL))110 this-> controllable->process(event);109 if (likely(this->playable != NULL)) 110 this->playable->process(event); 111 111 } 112 112 -
trunk/src/world_entities/player.h
r6871 r6985 1 1 /*! 2 2 * @file player.h 3 * Implements a basic controllable WorldEntity3 * Implements a basic playable WorldEntity 4 4 */ 5 5 … … 15 15 16 16 17 //! Basic controllable WorldEntity17 //! Basic playable WorldEntity 18 18 /** 19 19 * this is the debug player - actualy we would have to make a new … … 28 28 virtual ~Player(); 29 29 30 bool set Controllable(Playable* controllalble);31 inline Playable* get Controllable() { return this->controllable; };32 bool disconnect Controllable();30 bool setPlayable(Playable* controllalble); 31 inline Playable* getPlayable() { return this->playable; }; 32 bool disconnectPlayable(); 33 33 34 34 void weaponConfigChanged(); … … 38 38 39 39 private: 40 Playable* controllable; //!< The one we controll or NULL if none40 Playable* playable; //!< The one we controll or NULL if none 41 41 Hud hud; //!< The HUD to be displayed for this Player. 42 42 };
Note: See TracChangeset
for help on using the changeset viewer.