Changeset 11272 for code/branches/SpaceRace_HS16/src/modules
- Timestamp:
- Nov 7, 2016, 4:00:25 PM (8 years ago)
- Location:
- code/branches/SpaceRace_HS16/src/modules/gametypes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.cc
r11260 r11272 36 36 #include "items/Engine.h" 37 37 #include "controllers/HumanController.h" 38 #include "SpaceRaceBot.h"39 38 40 39 #include "core/CoreIncludes.h" … … 43 42 #include "worldentities/pawns/Pawn.h" 44 43 #include "core/config/ConfigValueIncludes.h" 44 #include "infos/Bot.h" 45 #include "SpaceRaceBot.h" 45 46 46 47 … … 56 57 57 58 //this->botclass_ = Class(); 59 this->botclass_ = Class(SpaceRaceBot);//ClassByString("") 58 60 59 61 this->checkpointsReached_ = 0; … … 168 170 } 169 171 172 /*void playerEntered(PlayerInfo* player) { 173 174 175 Gametype::playerEntered(player); 176 177 const std::string& message = player->getName() + " entered the game"; 178 ChatManager::message(message); 179 180 }*/ 181 182 183 184 185 void OldSpaceRace::addBots(unsigned int amount) 186 { 187 for (unsigned int i = 0; i < amount; ++i) 188 this->botclass_.fabricate(this->getContext()); 189 } 190 191 192 193 170 194 171 195 } -
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.h
r11256 r11272 38 38 39 39 #include "gametypes/Gametype.h" 40 #include "SpaceRaceManager.h" 40 41 41 42 #include "OldRaceCheckPoint.h" … … 63 64 virtual void playerEntered(PlayerInfo* player) override; 64 65 virtual void newCheckpointReached(); 65 virtual void addBots(unsigned int amount) override {}//<! overwrite function in order to bypass the addbots command.66 virtual void addBots(unsigned int amount) override; //<! overwrite function in order to bypass the addbots command. 66 67 //<! This is only a temporary solution. Better: create racingBots. 67 68 -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.cc
r11256 r11272 23 23 * Author: purgham 24 24 */ 25 #include <vector> 25 26 26 27 #include "SpaceRaceBot.h" 28 #include "core/GameMode.h" 27 29 #include "core/CoreIncludes.h" 30 #include "core/config/ConfigValueIncludes.h" 31 #include "gametypes/Gametype.h" 32 #include "controllers/AIController.h" 33 #include "gametypes/SpaceRaceController.h" 34 35 28 36 29 37 namespace orxonox … … 33 41 SpaceRaceBot::SpaceRaceBot(Context* context) : Bot(context){ 34 42 RegisterObject(SpaceRaceBot); 35 this->defaultController_ = Class(SpaceRaceController);// ClassByString("") 36 this->createController(); 37 } 43 this->defaultController_ = Class(AIController);// ClassByString("") 44 38 45 39 46 … … 41 48 42 49 50 this->createController(); 51 52 } 53 54 SpaceRaceBot::~SpaceRaceBot(){ 55 56 } 57 58 void SpaceRaceBot::setConfigValues() 59 { 60 static const std::string names[] = 61 { 62 "Dr. Julius No", 63 "Berkay Berabi", 64 "Louis Meile" 65 66 "Dominic Greene" 67 }; 68 static std::vector<std::string> defaultnames(names, names + sizeof(names) / sizeof(std::string)); 69 70 SetConfigValue(names_, defaultnames); 71 } 72 43 73 44 74 -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.h
r11239 r11272 30 30 #include "gametypes/GametypesPrereqs.h" 31 31 #include "gametypes/SpaceRaceController.h" 32 #include <vector> 32 33 33 34 … … 35 36 { 36 37 37 /**38 /sdaasdasdasdasdas39 */40 38 class _GametypesExport SpaceRaceBot: public Bot 41 39 { 42 40 public: 43 SpaceRaceBot(Context* context); 44 virtual ~SpaceRaceBot() {} 41 SpaceRaceBot(Context* context); 42 virtual ~SpaceRaceBot(); 43 44 void setConfigValues(); 45 46 47 48 virtual inline bool isInitialized() const override 49 { return true; } 50 virtual inline float getPing() const override 51 { return 0; } 52 virtual inline float getPacketLossRatio() const override 53 { return 0; } 54 55 56 private: 57 std::vector<std::string> names_; 58 59 45 60 }; 46 61 } -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceManager.cc
r11071 r11272 47 47 RegisterObject(SpaceRaceManager); 48 48 this->race_ = orxonox_cast<SpaceRace*>(this->getGametype()); 49 assert(race_);49 //assert(race_); 50 50 //amountOfPlayers=(race_->getPlayers()).size(); 51 51 this->firstcheckpointvisible_ = false;
Note: See TracChangeset
for help on using the changeset viewer.