Changeset 7031
- Timestamp:
- May 31, 2010, 4:42:57 AM (14 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 9 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3
- Property svn:mergeinfo changed
/code/branches/dynamicmatch (added) merged: 6584,6586,6603,6686,6692,6697,6812,6848,6921,6954-6955,6959,6987
- Property svn:mergeinfo changed
-
code/branches/presentation3/data/levels/gametype_dynamicmatch.oxw
- Property svn:eol-style set to native
-
code/branches/presentation3/data/overlays/dynamicmatchhud.oxo
- Property svn:eol-style set to native
-
code/branches/presentation3/src/modules/overlays/OverlaysPrereqs.h
r5929 r7031 78 78 class ChatOverlay; 79 79 class DeathMessage; 80 class GametypeFadingMessage; 81 class GametypeStaticMessage; 80 82 class GametypeStatus; 81 83 class HUDBar; -
code/branches/presentation3/src/modules/overlays/hud/CMakeLists.txt
r5781 r7031 13 13 UnderAttackHealthBar.cc 14 14 TeamBaseMatchScore.cc 15 GametypeStaticMessage.cc 16 GametypeFadingMessage.cc 15 17 ) -
code/branches/presentation3/src/modules/overlays/hud/GametypeFadingMessage.cc
- Property svn:eol-style set to native
-
code/branches/presentation3/src/modules/overlays/hud/GametypeFadingMessage.h
- Property svn:eol-style set to native
-
code/branches/presentation3/src/modules/overlays/hud/GametypeStaticMessage.cc
- Property svn:eol-style set to native
-
code/branches/presentation3/src/modules/overlays/hud/GametypeStaticMessage.h
- Property svn:eol-style set to native
-
code/branches/presentation3/src/orxonox/OrxonoxPrereqs.h
r6524 r7031 90 90 class Asteroids; 91 91 class Deathmatch; 92 class Dynamicmatch; 92 93 class Gametype; 93 94 class TeamBaseMatch; -
code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc
r6502 r7031 34 34 #include "worldentities/pawns/TeamBaseMatchBase.h" 35 35 #include "gametypes/TeamDeathmatch.h" 36 #include "gametypes/Dynamicmatch.h" 36 37 #include "controllers/WaypointPatrolController.h" 37 38 … … 245 246 } 246 247 248 Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype); 249 if (dynamic) 250 { 251 if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;} 252 253 if (entity1->getPlayer()) 254 team1 = dynamic->getParty(entity1->getPlayer()); 255 256 if (entity2->getPlayer()) 257 team2 = dynamic->getParty(entity2->getPlayer()); 258 259 if (team1 ==-1 ||team2 ==-1 ) {return false;} 260 else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;} 261 else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;} 262 else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;} 263 else return true; 264 } 265 247 266 return (team1 == team2 && team1 != -1); 248 267 } -
code/branches/presentation3/src/orxonox/gametypes/CMakeLists.txt
r5781 r7031 6 6 UnderAttack.cc 7 7 Asteroids.cc 8 Dynamicmatch.cc 8 9 ) -
code/branches/presentation3/src/orxonox/infos/GametypeInfo.cc
r5781 r7031 42 42 registerMemberNetworkFunction(GametypeInfo, dispatchKillMessage); 43 43 registerMemberNetworkFunction(GametypeInfo, dispatchDeathMessage); 44 registerMemberNetworkFunction(GametypeInfo, dispatchStaticMessage); 45 registerMemberNetworkFunction(GametypeInfo, dispatchFadingMessage); 44 46 45 47 GametypeInfo::GametypeInfo(BaseObject* creator) : Info(creator) … … 110 112 } 111 113 114 void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID) 115 { 116 if (GameMode::isMaster()) 117 { 118 if (clientID == CLIENTID_SERVER) 119 this->dispatchStaticMessage(message); 120 else 121 callMemberNetworkFunction(GametypeInfo, dispatchStaticMessage, this->getObjectID(), clientID, message); 122 } 123 } 124 125 void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) 126 { 127 if (GameMode::isMaster()) 128 { 129 if (clientID == CLIENTID_SERVER) 130 this->dispatchFadingMessage(message); 131 else 132 callMemberNetworkFunction(GametypeInfo, dispatchFadingMessage, this->getObjectID(), clientID, message); 133 } 134 } 135 112 136 void GametypeInfo::dispatchAnnounceMessage(const std::string& message) 113 137 { … … 127 151 it->deathmessage(this, message); 128 152 } 153 154 void GametypeInfo::dispatchStaticMessage(const std::string& message) 155 { 156 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) 157 it->staticmessage(this, message); 158 } 159 160 void GametypeInfo::dispatchFadingMessage(const std::string& message) 161 { 162 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) 163 it->fadingmessage(this, message); 164 } 129 165 } -
code/branches/presentation3/src/orxonox/infos/GametypeInfo.h
r5781 r7031 64 64 void sendKillMessage(const std::string& message, unsigned int clientID); 65 65 void sendDeathMessage(const std::string& message, unsigned int clientID); 66 void sendStaticMessage(const std::string& message, unsigned int clientID); 67 void sendFadingMessage(const std::string& message, unsigned int clientID); 66 68 67 69 void dispatchAnnounceMessage(const std::string& message); 68 70 void dispatchKillMessage(const std::string& message); 69 71 void dispatchDeathMessage(const std::string& message); 72 void dispatchStaticMessage(const std::string& message); 73 void dispatchFadingMessage(const std::string& message); 70 74 71 75 private: -
code/branches/presentation3/src/orxonox/interfaces/GametypeMessageListener.h
r5781 r7031 44 44 virtual void killmessage(const GametypeInfo* gtinfo, const std::string& message) {} 45 45 virtual void deathmessage(const GametypeInfo* gtinfo, const std::string& message) {} 46 virtual void staticmessage(const GametypeInfo* gtinfo, const std::string& message) {} 47 virtual void fadingmessage(const GametypeInfo* gtinfo, const std::string& message) {} 46 48 }; 47 49 }
Note: See TracChangeset
for help on using the changeset viewer.