5 #ifndef __RD_MENTAL_MAP_HPP__
6 #define __RD_MENTAL_MAP_HPP__
13 #include "MentalMapEventListener.hpp"
14 #include "NetworkEventListener.hpp"
15 #include "AudioManager.hpp"
55 std::vector<Target> getTargets()
const;
56 std::vector<Player> getPlayers()
const;
57 Target getTarget(
const int&
id = -1)
const;
58 Player getPlayer(
const int&
id = -1)
const;
66 void addWeapon(
Weapon weapon);
67 Weapon getCurrentWeapon()
const;
79 bool updatePlayers(
const std::vector<Player> & new_player_vector);
87 bool updateTargets(
const std::vector<Target> & new_target_detections);
153 #endif //__RD_MENTAL_MAP_HPP__
Mental map is a repository for information about the players, targets and weapons.
Definition: MentalMap.hpp:38
Music and sound effects manager.
Definition: AudioManager.hpp:28
bool shoot()
Manage all the actions to be carried out when the user shoots (sound, update players,...
Definition: MentalMap.cpp:137
std::vector< Weapon > weapons
Storage for the weapons data.
Definition: MentalMap.hpp:124
bool updateTargets(const std::vector< Target > &new_target_detections)
Update the targets stored in the mental map.
Definition: MentalMap.cpp:218
int my_id
Id of the player corresponding to the user.
Definition: MentalMap.hpp:131
Class that represents a player of this game, with a 'unique' id, name, health, team id and score.
Definition: Player.hpp:21
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
std::map< int, Target > targets
Storage for the target data. The key of the dictionary is the player id.
Definition: MentalMap.hpp:118
bool respawn()
Restores the health of current player (and does more stuff if needed)
Definition: MentalMap.cpp:237
bool onDataArrived(const std::vector< Player > &players)
Updates the local information about the players with the new data received by the NetworkManager.
Definition: MentalMap.cpp:260
bool updatePlayers(const std::vector< Player > &new_player_vector)
The current implementation just replaces the players inside the mental map by the new players.
Definition: MentalMap.cpp:198
bool reload()
Manage all the actions to be carried out when the user reloads (sound, update weapons,...
Definition: MentalMap.cpp:192
Player * myself
Pointer to the player corresponding to the user.
Definition: MentalMap.hpp:134
bool configure(const int &player_id)
Store the id of the player corresponding to the user.
Definition: MentalMap.cpp:46
Class that represents a weapon.
Definition: Weapon.hpp:22
AudioManager * audioManager
Reference to the AudioManager.
Definition: MentalMap.hpp:138
bool removeMentalMapEventListeners()
Unregisters all the MentalMapEventListener stored.
Definition: MentalMap.cpp:254
Class that represents a target detected. This target is (or should be) associated to a player.
Definition: Target.hpp:18
std::vector< MentalMapEventListener * > listeners
Observers registered to be notified of data change events.
Definition: MentalMap.hpp:142
Interface for objects that can be notified of input events by the NetworkManager.
Definition: NetworkEventListener.hpp:18
bool addMentalMapEventListener(MentalMapEventListener *listener)
Adds a MentalMapEventListener to the list of observers to be notified of events.
Definition: MentalMap.cpp:248
static MentalMap * mentalMapInstance
Stores the unique instance of the MentalMap.
Definition: MentalMap.hpp:114
int current_weapon
Index of the weapon currenly selected.
Definition: MentalMap.hpp:127
static MentalMap * getMentalMap()
Get a reference to the MentalMap.
Definition: MentalMap.cpp:27
MentalMap()
Constructor.
Definition: MentalMap.cpp:18
std::map< int, Player > players
Storage for the players data. The key of the dictionary is the player id.
Definition: MentalMap.hpp:121
Player getMyself() const
Get the player corresponding to the user.
Definition: MentalMap.cpp:106
static bool destroyMentalMap()
Get a reference to the MentalMap.
Definition: MentalMap.cpp:35
Interface for objects that can be notified of events related to changes on the data stored.
Definition: MentalMapEventListener.hpp:21