- Timestamp:
- May 23, 2009, 7:04:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/objects/gametypes/TeamBaseMatch.cc
r3019 r3020 20 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 21 * 22 * Author: Val Mikos 22 * Author: 23 * Val Mikos 24 * Co-authors: 25 * ... 26 * 23 27 */ 24 25 26 28 27 29 #include "TeamBaseMatch.h" 28 30 29 30 #include "objects/worldentities/pawns/TeamBaseMatchBase.h" 31 #include "objects/worldentities/pawns/TeamBaseMatchBase.h" 31 32 #include "core/CoreIncludes.h" 32 #include "core/XMLPort.h" 33 34 33 35 34 namespace orxonox 36 35 { 37 36 CreateUnloadableFactory(TeamBaseMatch); 38 37 39 40 // Timer and Creator41 38 TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathmatch(creator) 42 39 { … … 49 46 this->pointsTeam2_ = 0; 50 47 } 51 52 53 // set the Bases positions using XML54 void TeamBaseMatch::XMLPort(Element& xmlelement, XMLPort::Mode mode)55 {56 SUPER(TeamBaseMatch, XMLPort, xmlelement, mode);57 58 // XMLPortObject(TeamBaseMatch, WorldEntity, setNeutralshape, getNeturalshape, xmlelement, mode);59 // XMLPortObject(TeamBaseMatch, WorldEntity, setTeam1shape, getTeam1shape, xmlelement, mode);60 // XMLPortObject(TeamBaseMatch, WorldEntity, setTeam2shape, getTeam2shape, xmlelement, mode);61 62 // XMLPortObject(TeamBaseMatch, TeamBaseMatchBase, addBase, getBase, xmlelement, mode);63 }64 65 /*66 // pretty useless at the moment...should be implemented in the TeamBaseMatchBase class headerfile67 // State of the Base (controlled, uncontrolled)68 int TeamBaseMatch::baseState(Base)69 {70 if(Enum state_==uncontrolled) return 0;71 if(Enum state_==controlTeam1) return 1;72 if(Enum state_==controlTeam2) return 2;73 }74 */75 76 48 77 49 // Change the control of the defeated base and respawn it with its initial health … … 117 89 { 118 90 std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer()); 119 120 121 122 switch(base->getState())91 int teamnrbase = -1; 92 int teamnrplayer = getTeam(pawn1->getPlayer()); 93 94 switch (base->getState()) 123 95 { 124 96 case BaseState::controlTeam1: … … 130 102 case BaseState::uncontrolled: 131 103 default: 132 teamnrbase = -1; 133 } 134 135 136 if(teamnrbase == teamnrplayer){ 137 return false; 138 } 104 teamnrbase = -1; 105 } 106 107 if (teamnrbase == teamnrplayer) 108 return false; 139 109 } 140 110 return true; … … 155 125 void TeamBaseMatch::showPoints() 156 126 { 157 127 158 128 COUT(0) << "Points standing:" << std::endl << "Team 1: "<< pointsTeam1_ << std::endl << "Team 2: " << pointsTeam2_ << std::endl; 159 129 if(pointsTeam1_ >=1700) COUT(0) << "Team 1 is near victory!" << std::endl; … … 205 175 { 206 176 this->pointsTeam2_ += points; 207 } 177 } 208 178 209 179 this->endGame(); … … 227 197 return 0; 228 198 } 229 199 230 200 } 231 201 232 202
Note: See TracChangeset
for help on using the changeset viewer.