- Timestamp:
- Apr 27, 2009, 4:26:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.