- Timestamp:
- Apr 8, 2009, 12:58:47 AM (15 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/gamestates/GSClient.cc
r2907 r2908 31 31 32 32 #include "core/input/InputManager.h" 33 #include "core/Clock.h"34 33 #include "core/CommandLine.h" 35 #include "core/Game.h" 36 #include "core/GameMode.h" 34 #include "core/Core.h" 37 35 #include "network/Client.h" 38 36 39 37 namespace orxonox 40 38 { 41 AddGameState(GSClient, "client");42 43 39 SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#"); 44 40 45 GSClient::GSClient( const std::string& name)46 : GameState (name)41 GSClient::GSClient() 42 : GameState<GSGraphics>("client") 47 43 , client_(0) 48 44 { … … 53 49 } 54 50 55 void GSClient:: activate()51 void GSClient::enter() 56 52 { 57 GameMode::setIsClient(true);53 Core::setIsClient(true); 58 54 59 55 this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); … … 62 58 ThrowException(InitialisationFailed, "Could not establish connection with server."); 63 59 64 client_->update(Game::getInstance().getGameClock()); 60 GSLevel::enter(this->getParent()->getViewport()); 61 62 client_->tick(0); 65 63 } 66 64 67 void GSClient:: deactivate()65 void GSClient::leave() 68 66 { 67 GSLevel::leave(); 68 69 69 client_->closeConnection(); 70 70 … … 72 72 delete this->client_; 73 73 74 GameMode::setIsClient(false);74 Core::setIsClient(false); 75 75 } 76 76 77 void GSClient:: update(const Clock& time)77 void GSClient::ticked(const Clock& time) 78 78 { 79 client_->update(time); 79 GSLevel::ticked(time); 80 client_->tick(time.getDeltaTime()); 81 82 this->tickChild(time); 80 83 } 81 84 }
Note: See TracChangeset
for help on using the changeset viewer.