Phoenix2D-Library  0.10
BeforeKickOff.cpp
Go to the documentation of this file.
1 /*
2  * Phoenix2D (RoboCup Soccer Simulation 2D League)
3  * Copyright (c) 2013 Ivan Gonzalez
4  *
5  * This file is part of Phoenix2D.
6  *
7  * Phoenix2D is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * Phoenix2D is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Phoenix2D. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include <iostream>
22 #include <cmath>
23 #include "BeforeKickOff.h"
24 #include "Game.h"
25 #include "Commands.h"
26 #include "Config.h"
27 #include "Self.h"
28 namespace Phoenix
29 {
31 
32 }
33 
35 
36 }
37 
39  Position initPosition = Config::POSITION;
40  commands->move(initPosition.getX(), initPosition.getY());
41 }
42 
44  Position myPosition = Self::getPosition();
45  if (std::abs(myPosition.getBodyDirection()) > 1.0) {
46  commands->turn(-1.0 * myPosition.getBodyDirection());
47  }
48 }
49 
51 
52 }
53 
55 
56 }
57 
58 void BeforeKickOff::onMessageReceived(std::string message, int sender) {
59 
60 }
61 }
Commands * commands
Definition: PlayMode.h:61
Position The Position lorem Ipsum
Definition: Position.h:50
static Position getPosition()
Definition: Self.cpp:714
void onMessageReceived(std::string message, int sender)
void move(double x, double y)
Definition: Commands.cpp:52
Commands The Commans lorem Ipsum
Definition: Commands.h:42
void onGoalieExecute(WorldModel world)
WorldModel The WorldModel lorem Ipsum
Definition: WorldModel.h:38
double getBodyDirection()
Definition: Position.cpp:73
void turn(double moment)
Definition: Commands.cpp:62
void onCoachExecute(WorldModel world)
void onPlayerExecute(WorldModel world)
BeforeKickOff(Commands *commands)
PlayMode The PlayMode lorem Ipsum
Definition: PlayMode.h:59
static Position POSITION
Definition: Config.h:35
void setup(WorldModel world)