Changeset 11174 for code/branches/sagerjFS16/src/orxonox
- Timestamp:
- Apr 21, 2016, 4:47:39 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/orxonox
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.cc
r11170 r11174 40 40 namespace orxonox 41 41 { 42 extern const std::string __CC_ fire_name = "fire";42 extern const std::string __CC_push_name = "push"; 43 43 extern const std::string __CC_suicide_name = "suicide"; 44 44 extern const std::string __CC_release_name = "release"; … … 52 52 SetConsoleCommand("HumanController", "toggleFormationFlight", &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress); 53 53 SetConsoleCommand("HumanController", "FFChangeMode", &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress); 54 SetConsoleCommand("HumanController", __CC_ fire_name, &HumanController::fire).addShortcut().keybindMode(KeybindMode::OnHold);54 SetConsoleCommand("HumanController", __CC_push_name, &HumanController::push ).addShortcut().keybindMode(KeybindMode::OnHold); 55 55 SetConsoleCommand("HumanController", __CC_release_name, &HumanController::release ).addShortcut().keybindMode(KeybindMode::OnRelease); 56 56 SetConsoleCommand("HumanController", "reload", &HumanController::reload ).addShortcut(); … … 157 157 } 158 158 159 void HumanController:: fire(unsigned int firemode)160 { 161 if (HumanController::localController_s) 162 HumanController::localController_s->do Fire(firemode);163 } 164 165 void HumanController::do Fire(unsigned int firemode)166 { 167 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 168 { 169 HumanController::localController_s->controllableEntity_-> fire(firemode);159 void HumanController::push(unsigned int firemode) 160 { 161 if (HumanController::localController_s) 162 HumanController::localController_s->doPush(firemode); 163 } 164 165 void HumanController::doPush(unsigned int firemode) 166 { 167 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 168 { 169 HumanController::localController_s->controllableEntity_->push(firemode); 170 170 //if human fires, set slaves free. See FormationController::forceFreeSlaves() 171 171 if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL) -
code/branches/sagerjFS16/src/orxonox/controllers/HumanController.h
r11164 r11174 61 61 virtual void pitch(const Vector2& value); 62 62 63 static void fire(unsigned int firemode);64 virtual void do Fire(unsigned int firemode);63 static void push(unsigned int firemode); 64 virtual void doPush(unsigned int firemode); 65 65 static void release(unsigned int firemode); 66 66 virtual void doRelease(unsigned int firemode); -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.cc
r11170 r11174 276 276 } 277 277 278 void NewHumanController::do Fire(unsigned int firemode)278 void NewHumanController::doPush(unsigned int firemode) 279 279 { 280 280 if (!this->controllableEntity_) … … 291 291 else 292 292 { 293 HumanController::do Fire(firemode); //call for formationflight293 HumanController::doPush(firemode); //call for formationflight 294 294 } 295 295 } -
code/branches/sagerjFS16/src/orxonox/controllers/NewHumanController.h
r11166 r11174 54 54 static void decelerate(); 55 55 56 virtual void do Fire(unsigned int firemode) override;56 virtual void doPush(unsigned int firemode) override; 57 57 virtual void doRelease(unsigned int firemode) override; 58 58 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.cc
r11170 r11174 99 99 Fire this Weapon with the the WeaponMode defined by @param mode 100 100 */ 101 void Weapon:: fire(unsigned int mode)101 void Weapon::push(unsigned int mode) 102 102 { 103 103 // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for … … 125 125 { 126 126 float reloading_time = 0; 127 if (it->second-> fire(&reloading_time))127 if (it->second->push(&reloading_time)) 128 128 { 129 129 this->bReloading_ = true; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/Weapon.h
r11164 r11174 52 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 53 53 54 void fire(unsigned int mode);54 void push(unsigned int mode); 55 55 void release(unsigned int mode); 56 56 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11170 r11174 168 168 } 169 169 170 bool WeaponMode::push(float* reloadTime) 171 { 172 if( this->chargeable_) 173 { 174 // setting up a timer for knowing how long the weapon was charged 175 // and passes the value to this->cTime_ 176 } else { 177 return fire(reloadTime); 178 } 179 180 } 181 170 182 bool WeaponMode::release(float* reloadTime) 171 183 { 172 this->release(); 173 return false; 184 if( this->chargeable_) 185 { 186 return fire(reloadTime); 187 } 174 188 } 175 189 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
r11170 r11174 57 57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 58 58 59 virtual bool push(float* reloadTime); 60 virtual bool release(float* reloadTime); 59 61 virtual bool fire(float* reloadTime); 60 virtual bool release(float* reloadTime);61 62 bool reload(); 62 63 … … 165 166 166 167 virtual void fire() = 0; 167 virtual void release() {};168 168 169 169 unsigned int initialMunition_; -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.cc
r11170 r11174 74 74 Fire all weapons in this WeaponSet with the defined weaponmode. 75 75 */ 76 void WeaponPack:: fire(unsigned int weaponmode)76 void WeaponPack::push(unsigned int weaponmode) 77 77 { 78 78 for (Weapon* weapon : this->weapons_) 79 weapon-> fire(weaponmode);79 weapon->push(weaponmode); 80 80 } 81 81 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponPack.h
r11164 r11174 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 void fire(unsigned int weaponmode);48 void push(unsigned int weaponmode); 49 49 void release(unsigned int weaponmode); 50 50 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.cc
r11170 r11174 60 60 } 61 61 62 void WeaponSet:: fire()62 void WeaponSet::push() 63 63 { 64 64 // Fire all WeaponPacks with their defined weaponmode 65 65 for (const auto& mapEntry : this->weaponpacks_) 66 66 if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED) 67 mapEntry.first-> fire(mapEntry.second);67 mapEntry.first->push(mapEntry.second); 68 68 } 69 69 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSet.h
r11164 r11174 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 void fire();48 void push(); 49 49 void release(); 50 50 void reload(); -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.cc
r11170 r11174 287 287 Fires the @ref orxonox::WeaponSet with the specified firemode. 288 288 */ 289 void WeaponSystem:: fire(unsigned int firemode)289 void WeaponSystem::push(unsigned int firemode) 290 290 { 291 291 std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode); 292 292 if (it != this->weaponSets_.end() && it->second) 293 it->second-> fire();293 it->second->push(); 294 294 } 295 295 -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponSystem.h
r11164 r11174 74 74 void changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode); 75 75 76 void fire(unsigned int firemode);76 void push(unsigned int firemode); 77 77 void release(unsigned int firemode); 78 78 void reload(); -
code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc
r11170 r11174 299 299 } 300 300 301 void ControllableEntity:: fire(unsigned int firemode)301 void ControllableEntity::push(unsigned int firemode) 302 302 { 303 303 if(GameMode::isMaster()) 304 304 { 305 this-> fired(firemode);305 this->pushed(firemode); 306 306 } 307 307 else -
code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.h
r11164 r11174 96 96 { this->rotateRoll(Vector2(value, 0)); } 97 97 98 void fire(unsigned int firemode);98 void push(unsigned int firemode); 99 99 void release(unsigned int firemode); 100 virtual void fired(unsigned int firemode) {}100 virtual void pushed(unsigned int firemode) {} 101 101 virtual void released(unsigned int firemode) {} 102 102 virtual void reload() {} -
code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Pawn.cc
r11170 r11174 428 428 */ 429 429 430 void Pawn:: fired(unsigned int firemode)431 { 432 if (this->weaponSystem_) 433 this->weaponSystem_-> fire(firemode);430 void Pawn::pushed(unsigned int firemode) 431 { 432 if (this->weaponSystem_) 433 this->weaponSystem_->push(firemode); 434 434 } 435 435 -
code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Pawn.h
r11166 r11174 157 157 virtual void kill(); 158 158 159 virtual void fired(unsigned int firemode) override;159 virtual void pushed(unsigned int firemode) override; 160 160 virtual void released(unsigned int firemode) override; 161 161 virtual void postSpawn();
Note: See TracChangeset
for help on using the changeset viewer.