Changeset 7464 in orxonox.OLD for trunk/src/util
- Timestamp:
- May 1, 2006, 4:52:33 PM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/kill_target.cc
r7463 r7464 60 60 61 61 62 MissionState KillTarget::checkMissionGoal( )62 MissionState KillTarget::checkMissionGoal(float dt) 63 63 {} 64 64 -
trunk/src/util/kill_target.h
r7463 r7464 30 30 31 31 32 virtual MissionState checkMissionGoal( );32 virtual MissionState checkMissionGoal(float dt); 33 33 34 34 -
trunk/src/util/mission_goal.cc
r7463 r7464 17 17 18 18 #include "mission_goal.h" 19 #include "game_rules.h" 19 20 21 #include "state.h" 20 22 #include "util/loading/load_param.h" 21 23 … … 30 32 { 31 33 this->setClassID(CL_MISSION_GOAL, "MissionGoal"); 34 35 this->missionState = MS_PASSIVE; 36 // add the mission to the current game rule 37 GameRules* gr = State::getGameRules(); 38 if( gr) 39 gr->addMissionGoal(this); 32 40 33 41 if( root != NULL) -
trunk/src/util/mission_goal.h
r7463 r7464 16 16 { 17 17 MS_ACCOMPLISHED = 0, 18 MS_ RUNNING,18 MS_ACCEPTED, 19 19 MS_FAILED, 20 MS_PASSIVE, 20 21 21 22 MS_NUMBER … … 47 48 inline MissionState getMissionState() { return this->missionState; } 48 49 49 virtual MissionState checkMissionGoal( ) = 0;50 virtual MissionState checkMissionGoal(float dt) = 0; 50 51 51 52 -
trunk/src/util/singleplayer_shootemup.cc
r7462 r7464 20 20 #include "util/loading/factory.h" 21 21 22 #include "render2D/billboard.h" 23 #include "state.h" 24 #include "class_list.h" 25 26 #include "player.h" 27 #include "playable.h" 28 #include "space_ships/space_ship.h" 29 30 31 #include "shared_network_data.h" 32 #include "terrain.h" 33 #include "class_list.h" 34 #include "space_ships/space_ship.h" 22 #include "mission_goal.h" 35 23 36 24 … … 67 55 GameRules::loadParams(root) ; 68 56 69 // LoadParam(root, "death-penalty-timeout", this, SingleplayerShootemup, setDeathPenaltyTimeout) 70 // .describe("sets the time in seconds a player has to wait for respawn"); 71 // 72 // LoadParam(root, "max-kills", this, SingleplayerShootemup, setMaxKills) 73 // .describe("sets the maximal kills for winning condition"); 74 // 75 // LoadParam(root, "death-screen-image", this, SingleplayerShootemup, setDeathScreen) 76 // .describe("sets the death screen image"); 57 LoadParam(root, "death-screen-image", this, SingleplayerShootemup, setDeathScreen) 58 .describe("sets the death screen image"); 77 59 78 60 } … … 109 91 void SingleplayerShootemup::tick(float dt) 110 92 { 111 this->checkGameRules( );93 this->checkGameRules(dt); 112 94 } 113 95 … … 123 105 * check the game rules for consistency 124 106 */ 125 void SingleplayerShootemup::checkGameRules() 126 {} 107 void SingleplayerShootemup::checkGameRules(float dt) 108 { 109 PRINTF(0)("===========| Printing Mission State:\n"); 110 for (std::vector<MissionGoal*>::iterator it = this->missionList.begin(); it != this->missionList.end(); it++) 111 { 112 if( (*it)->checkMissionGoal(dt) != MS_ACCOMPLISHED) 113 { 114 PRINTF(0)(" Mission \"%s\" is not finished yet\n", (*it)->getMissionName().c_str()); 115 } 116 } 117 } 127 118 128 119 -
trunk/src/util/singleplayer_shootemup.h
r7391 r7464 35 35 36 36 protected: 37 virtual void checkGameRules( );37 virtual void checkGameRules(float dt); 38 38 39 39
Note: See TracChangeset
for help on using the changeset viewer.