Changeset 2934
- Timestamp:
- Apr 27, 2009, 4:26:49 PM (16 years ago)
- Location:
- code/branches/gametypes/src/orxonox
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/gamestates/GSLevel.cc
r2826 r2934 49 49 namespace orxonox 50 50 { 51 SetCommandLineArgument(level, " presentation_dm.oxw").shortcut("l");51 SetCommandLineArgument(level, "teambasematchlevel.oxw").shortcut("l"); 52 52 53 53 GSLevel::GSLevel() -
code/branches/gametypes/src/orxonox/objects/gametypes/CMakeLists.txt
r2933 r2934 3 3 Deathmatch.cc 4 4 TeamDeathmatch.cc 5 TeamBaseMatch.cc 5 6 Pong.cc 6 7 UnderAttack.cc -
code/branches/gametypes/src/orxonox/objects/gametypes/TeamBaseMatch.cc
r2903 r2934 25 25 26 26 27 #include TeamBaseMatch.h27 #include "TeamBaseMatch.h" 28 28 29 29 30 30 //implement this! not done yet! 31 31 #include "objects/worldentities/pawns/TeamBaseMatchBase.h" 32 32 #include "core/CoreIncludes.h" 33 #include "core/XMLPort.h" 34 33 35 34 36 namespace orxonox … … 38 40 39 41 // Timer and Creator 40 TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeath Match(creator)42 TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathmatch(creator) 41 43 { 42 44 RegisterObject(TeamBaseMatch); … … 53 55 void TeamBaseMatch::XMLPort(Element& xmlelement, XMLPort::Mode mode) 54 56 { 57 SUPER(TeamBaseMatch, XMLPort, xmlelement, mode); 58 55 59 // XMLPortObject(TeamBaseMatch, WorldEntity, setNeutralshape, getNeturalshape, xmlelement, mode); 56 60 // XMLPortObject(TeamBaseMatch, WorldEntity, setTeam1shape, getTeam1shape, xmlelement, mode); 57 61 // XMLPortObject(TeamBaseMatch, WorldEntity, setTeam2shape, getTeam2shape, xmlelement, mode); 58 62 59 XMLPortObject(TeamBaseMatch, TeamBaseMatchBase,addBase, getBase, xmlelement, mode);63 // XMLPortObject(TeamBaseMatch, TeamBaseMatchBase, addBase, getBase, xmlelement, mode); 60 64 } 61 65 66 /* 62 67 // pretty useless at the moment...should be implemented in the TeamBaseMatchBase class headerfile 63 68 // State of the Base (controlled, uncontrolled) … … 68 73 if(Enum state_==controlTeam2) return 2; 69 74 } 70 75 */ 76 77 78 // Change the control of the defeated base and respawn it with its initial health 71 79 bool TeamBaseMatch::allowPawnDeath(Pawn* victim, Pawn* originator) 72 80 { 73 set::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(victim);74 if ( it != this->bases_.end() && victim)81 TeamBaseMatchBase* base = dynamic_cast<TeamBaseMatchBase*>(victim); 82 if (base) 75 83 { 76 TeamBaseMatchBase* base = dynamic_cast<TeamBaseMatchBase*>(victim);77 if ( base)84 std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(base); 85 if (it != this->bases_.end()) 78 86 { 79 87 int teamnr = this->getTeam(originator->getPlayer()); … … 140 148 } 141 149 142 void addTeamPoints(int team, int points) 150 151 // this function is called by the function winPoints() which adds points to the teams for every base and killed openents at a certain time 152 void TeamBaseMatch::addTeamPoints(int team, int points) 143 153 { 144 if( player && teamnr== 0)154 if(team == 0) 145 155 { 146 156 this->pointsTeam1_ += points; 147 157 } 148 if( player && teamnr== 1)158 if(team == 1) 149 159 { 150 160 this->pointsTeam2_ += points; -
code/branches/gametypes/src/orxonox/objects/gametypes/TeamBaseMatch.h
r2903 r2934 36 36 37 37 #include "TeamDeathmatch.h" 38 #include " util/Timer.h"38 #include "tools/Timer.h" 39 39 40 40 … … 42 42 namespace orxonox 43 43 { 44 44 class TeamBaseMatchBase; 45 45 46 46 … … 48 48 { 49 49 public: 50 TeamBase match(BaseObject* creator);50 TeamBaseMatch(BaseObject* creator); 51 51 52 52 // if class closes, close everything … … 60 60 61 61 // give information about the state of a base 62 virtual int baseState(Base); 62 // (this should be pretty useless atm) 63 // virtual int baseState(Base); 63 64 64 65 virtual void playerScored(PlayerInfo* player); -
code/branches/gametypes/src/orxonox/objects/worldentities/pawns/CMakeLists.txt
r2933 r2934 3 3 Pawn.cc 4 4 SpaceShip.cc 5 TeamBaseMatchBase.cc 5 6 Destroyer.cc 6 7 ) -
code/branches/gametypes/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
r2903 r2934 39 39 #define _TeamBaseMatchBase_H__ 40 40 41 #include " pawn.h"41 #include "Pawn.h" 42 42 43 43 namespace orxonox … … 55 55 } 56 56 57 struct Base58 {59 BaseState::Enum state_;60 };61 57 62 63 64 65 66 67 class _OrxonoxExport TeamBaseMatchBase : public RadarViewable 58 class _OrxonoxExport TeamBaseMatchBase : public Pawn 68 59 { 69 60 public: 70 61 TeamBaseMatchBase(BaseObject* creator); 71 62 72 // if class closes, close everything 73 virtual ~TeamBaseMatchBase(); 74 75 virtual void setState(base) 76 { 77 78 63 // if class closes, close everything 64 virtual ~TeamBaseMatchBase() {} 65 66 67 68 // Set the state of a base to whatever the argument of the function is 69 void setState(BaseState::Enum state) 70 { 71 this->state_ = state; 79 72 } 80 virtual enum getState(base);81 82 83 73 84 74 85 86 protected: 75 // Get the state of a base as a return value 76 BaseState::Enum getState() 77 { 78 return this->state_; 79 } 87 80 88 81 82 protected: 89 83 90 91 92 84 BaseState::Enum state_; 85 }; 93 86 } 94 87
Note: See TracChangeset
for help on using the changeset viewer.