Phoenix2D-Library  0.10
Player.h
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 #ifndef PLAYER_H_
22 #define PLAYER_H_
23 
24 #include <string>
25 #include <vector>
26 #include "Position.h"
27 #include "Vector2D.h"
28 
32 namespace Phoenix
33 {
34 
39 class Player {
40  double distance;
41  double direction;
42  double distChange;
43  double dirChange;
44  double bodyDirection;
45  double headDirection;
46  double pointDir;
47  double x;
48  double y;
49  double vx;
50  double vy;
51  double theta;
52  bool body_b;
53  bool head_b;
54  bool pointing;
55  bool kicking;
56  bool tackling;
57  std::string team;
60  bool goalie;
61  //Player* bound;
62  int player_id;
65  bool is_bounded;
66  std::vector<Player*> pretenders;
69 public:
70  Player();
71  Player(std::string name, std::string position, int simulation_time);
72  Player(std::string name, std::string position, int simulation_time, Position player_position, Vector2D player_velocity);
73  ~Player();
75  std::string getTeam();
76  int getUniformNumber();
78  bool isGoalie();
79  bool isPointing();
80  double getPointingDirection();
81  bool isKicking();
82  bool isTackling();
83  void boundTo(Player* player);
84  //Player* getBound();
85  void setPlayerId(int player_id);
86  int getPlayerId();
87  void toggleSightRange();
88  bool isInSightRange();
89  void pretendToBound(Player* player);
90  int getPretendersCount();
92  bool localized();
93  bool bounded();
94  std::string print();
95 };
96 } // End namespace Phoenix
99 #endif /* PLAYER_H_ */
Position position
Definition: Player.h:67
double theta
Definition: Player.h:51
double distChange
Definition: Player.h:42
Player The Player lorem Ipsum
Definition: Player.h:39
double headDirection
Definition: Player.h:45
bool isKicking()
Definition: Player.cpp:345
bool is_in_sight_range
Definition: Player.h:63
bool isInSightRange()
Definition: Player.cpp:371
Position The Position lorem Ipsum
Definition: Position.h:50
bool head_b
Definition: Player.h:53
void boundTo(Player *player)
Definition: Player.cpp:353
double y
Definition: Player.h:48
double x
Definition: Player.h:47
bool is_localized
Definition: Player.h:64
bool isTackling()
Definition: Player.cpp:349
Vector2D velocity
Definition: Player.h:68
double bodyDirection
Definition: Player.h:44
void pretendToBound(Player *player)
Definition: Player.cpp:375
double direction
Definition: Player.h:41
int getUniformNumber()
Definition: Player.cpp:324
double dirChange
Definition: Player.h:43
bool goalie
Definition: Player.h:60
std::string getTeam()
Definition: Player.cpp:320
std::string team
Definition: Player.h:57
bool localized()
Definition: Player.cpp:387
double getPointingDirection()
Definition: Player.cpp:341
double pointDir
Definition: Player.h:46
bool tackling
Definition: Player.h:56
double vx
Definition: Player.h:49
double distance
Definition: Player.h:40
bool pointing
Definition: Player.h:54
Player * getPretenderFront()
Definition: Player.cpp:383
int simulation_time
Definition: Player.h:59
void toggleSightRange()
Definition: Player.cpp:367
bool isGoalie()
Definition: Player.cpp:333
int getPretendersCount()
Definition: Player.cpp:379
void setPlayerId(int player_id)
Definition: Player.cpp:359
std::vector< Player * > pretenders
Definition: Player.h:66
int getPlayerId()
Definition: Player.cpp:363
bool is_bounded
Definition: Player.h:65
bool kicking
Definition: Player.h:55
bool body_b
Definition: Player.h:52
Position getPosition()
Definition: Player.cpp:311
bool bounded()
Definition: Player.cpp:391
std::string print()
Definition: Player.cpp:395
double vy
Definition: Player.h:50
int uniform_number
Definition: Player.h:58
int player_id
Definition: Player.h:62
Vector2D getVelocity()
Definition: Player.cpp:328
bool isPointing()
Definition: Player.cpp:337
Vector2D The Vector2D lorem Ipsum
Definition: Vector2D.h:45