Phoenix2D-Library  0.10
Controller.h
Go to the documentation of this file.
1 // $Id$
2 /*
3  * Phoenix2D (RoboCup Soccer Simulation 2D League)
4  * Copyright (c) 2013 Ivan Gonzalez
5  *
6  * This file is part of Phoenix2D.
7  *
8  * Phoenix2D is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Phoenix2D is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Phoenix2D. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * @file Controller.h
22  *
23  *
24  *
25  * @author Iván González
26  */
27  // $Log$
28 
29 #ifndef CONTROLLER_H_
30 #define CONTROLLER_H_
31 
32 #include <string>
33 
40 namespace Phoenix
41 {
42 
43 class Connect;
44 class Reader;
45 class Server;
46 class Parser;
47 class Commands;
48 class World;
49 class Self;
50 
75 class Controller
76 {
77 public:
78  static char AGENT_TYPE;
79 
84  Controller(const char *teamName, char agentType, const char *hostname);
87  ~Controller();
91  void connect();
94  bool isConnected();
97  void reconnect();
100  void disconnect();
106  World* getWorld();
109  Self* getSelf();
110 private:
117  Self* self;
118  bool connected;
119  std::string team_name;
120  std::string hostname;
121 };
122 
123 } // End namespace Phoenix
126 #endif /* CONTROLLER_H_ */
Parser * parser
Pointer to inner Parser Object.
Definition: Controller.h:111
void connect()
The main connection, should be called before anything else in Phoenix2D.
Definition: Controller.cpp:60
void disconnect()
Disconnect service.
Definition: Controller.cpp:154
std::string hostname
Definition: Controller.h:120
Server * server
Pointer to inner Server Object.
Definition: Controller.h:114
bool connected
Connection status.
Definition: Controller.h:118
Commands The Commans lorem Ipsum
Definition: Commands.h:42
World * getWorld()
World getter.
Definition: Controller.cpp:168
World * world
Pointer to inner World Object.
Definition: Controller.h:116
Controller The Controller is the Main Manager of the Phoenix2D Player. It is composed of referenc...
Definition: Controller.h:75
Parser The Parser lorem Ipsum
Definition: Parser.h:44
Self The Self lorem Ipsum
Definition: Self.h:45
Commands * commands
Pointer to inner Commans Object.
Definition: Controller.h:115
World The World lorem Ipsum
Definition: World.h:41
Controller(const char *teamName, char agentType, const char *hostname)
Default Constructor.
Definition: Controller.cpp:36
Reader * reader
Pointer to inner Reader Object.
Definition: Controller.h:113
Commands * getCommands()
Commands getter.
Definition: Controller.cpp:161
Connect * c
Pointer to inner Connect Object.
Definition: Controller.h:112
Server The Server lorem Ipsum
Definition: Server.h:38
std::string team_name
Definition: Controller.h:119
void reconnect()
Reconnection Logic.
Definition: Controller.cpp:150
Reader The Reader lorem Ipsum
Definition: Reader.h:39
Self * getSelf()
Self getter.
Definition: Controller.cpp:172
static char AGENT_TYPE
p = Player, t = Trainer
Definition: Controller.h:78
~Controller()
Default Destructor.
Definition: Controller.cpp:50