Robot Devastation
Target.hpp
1 // Authors: see AUTHORS.md at project root.
2 // CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
3 // URL: https://github.com/asrob-uc3m/robotDevastation
4 
5 #ifndef __RD_TARGET_HPP__
6 #define __RD_TARGET_HPP__
7 
8 #include "Vector2dBase.hpp"
9 
10 namespace rd{
11 
18 class Target
19 {
20 public:
22  Target();
23  Target( int player_id, const Vector2d &pos, const Vector2d &dimensions);
24 
25  int getPlayerId() const;
26  void setPlayerId(int id);
27 
28  const Vector2d & getPos() const;
29  void setPos(const Vector2d &pos);
30 
31  const Vector2d & getDimensions() const;
32  void setDimensions(const Vector2d &dimensions);
33 
34  int getBelief() const;
35  bool reduceBelief(int amount);
36  bool resetBelief();
37 
38 private:
40  int player_id;
41 
44 
47 
49  int belief;
50 
51  static const int MAX_BELIEF = 100;
52 };
53 }
54 
55 #endif //__RD_TARGET_HPP__
rd::Target::player_id
int player_id
Id of the player that is represented by this target.
Definition: Target.hpp:40
rd
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
rd::Target::pos
Vector2d pos
Center of the box that bounds this target.
Definition: Target.hpp:43
rd::Target::belief
int belief
Quantity representing how sure we are that this target can currently be seen by the user's robot.
Definition: Target.hpp:49
rd::Target::dimensions
Vector2d dimensions
Height and Width of the box that bounds this target.
Definition: Target.hpp:46
rd::Target
Class that represents a target detected. This target is (or should be) associated to a player.
Definition: Target.hpp:18
rd::Target::Target
Target()
Constructs a default, dummy target. (That is invalid for the game, by the way)
Definition: Target.cpp:7
rd::Vector2dBase< int >