5 #ifndef __RD_NETWORK_MANAGER_HPP__
6 #define __RD_NETWORK_MANAGER_HPP__
15 #include "NetworkEventListener.hpp"
16 #include "NetworkManager.hpp"
17 #include "MentalMapEventListener.hpp"
67 virtual bool start() = 0;
70 virtual bool stop() = 0;
84 virtual bool configure(
const std::string & parameter,
const Player & value);
94 virtual bool login() = 0;
137 #endif //-- __RD_NETWORK_MANAGER_HPP__
virtual bool start()=0
Start the network manager.
virtual bool keepAlive()=0
Keeps the user connected to the server (requires to be called periodically)
static bool Register(NetworkManager *manager, const std::string &id)
This function allows subclasses to install their unique instances in the singleton register to be sel...
Definition: NetworkManager.cpp:120
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
bool onTargetHit(const Target &target, const Player &player, const Weapon &weapon)
Implementation of MentalMapEventListener interface.
Definition: NetworkManager.cpp:110
bool onRespawn(const Player &player)
Implementation of MentalMapEventListener interface.
Definition: NetworkManager.cpp:115
static NetworkManager * networkManagerInstance
Stores the unique instance of the NetworkManager.
Definition: NetworkManager.hpp:124
bool addNetworkEventListener(NetworkEventListener *listener)
Adds a NetworkEventListener to the list of observers to be notified of events.
Definition: NetworkManager.cpp:93
virtual bool isStopped() const =0
Returns true if manager is stopped (obviously)
virtual bool sendPlayerHit(const Player &player, int damage)=0
Communicate to the network that a player has been hit by the user.
virtual bool configure(const std::string ¶meter, const Player &value)
Configures a parameter with a value.
Definition: NetworkManager.cpp:105
Class that represents a weapon.
Definition: Weapon.hpp:22
static std::map< std::string, NetworkManager * > networkManagerRegistry
Stores all the NetworkManager that have been registered.
Definition: NetworkManager.hpp:130
static bool destroyNetworkManager()
Deallocate all the registered NetworkManager.
Definition: NetworkManager.cpp:53
bool removeNetworkEventListeners()
Unregisters all the NetworkEventListener stored.
Definition: NetworkManager.cpp:99
virtual bool logout()=0
Log the user out of the network.
virtual bool stop()=0
Stop the network manager.
static std::string currentId
Stores the id of the current unique instance used.
Definition: NetworkManager.hpp:127
Class that represents a target detected. This target is (or should be) associated to a player.
Definition: Target.hpp:18
static NetworkManager * getNetworkManager()
Get a reference to the NetworkManager.
Definition: NetworkManager.cpp:16
std::vector< NetworkEventListener * > listeners
Observers registered to be notified of network events.
Definition: NetworkManager.hpp:119
Interface for objects that can be notified of input events by the NetworkManager.
Definition: NetworkEventListener.hpp:18
Manages the communications between the user and the RobotDevastation network.
Definition: NetworkManager.hpp:37
Interface for objects that can be notified of events related to changes on the data stored.
Definition: MentalMapEventListener.hpp:21
virtual bool login()=0
Log the user into the network.