17 #ifndef PLAYERMANAGER_H
18 #define PLAYERMANAGER_H
20 #include <GameInput/ControllerManager.h>
120 void addPlayerController(
int deviceId);
124 void removePlayerController(
int deviceId);
129 virtual void onDeviceConnectionChanged(
int deviceId,
bool isConnected)
override;
136 int mMinAvailablePlayerId = 0;
143 #endif // PLAYERMANAGER_H
Manages a mapping from unique player identifiers to different controllers that connect and disconnect...
Definition: PlayerManager.h:36
float getHorizontal(int player) const
Returns the horizontal movement value [-1.0f, 1.0f] for player.
bool contains(const Key &key) const
PlayerAction
Different actions or expressions of intent a player can make in the game.
Definition: PlayerManager.h:45
Software represention and state capable of describing almost all physical controllers.
Definition: VirtualController.h:36
void reset()
Resets all the player <-> controller mappings.
QList< Key > keys() const
Interface for listening to changes in device connection statuses.
Definition: ControllerManager.h:38
Action for magnetizing.
Definition: PlayerManager.h:61
void playerActivationChanged(int playerId, bool status)
Emitted when player playerId becomes either activated (i.e. connects a controller) or deactivated (i...
PlayerManager(QObject *parent=nullptr)
Constructs a PlayerManager.
static PlayerManager * getInstance()
Returns the global singleton instance of the PlayerManager, creating it if necessary.
bool isPlayerAvailable(int player) const
Returns whether or not player is available (i.e. currently connected with a controller).
Definition: PlayerManager.h:76
Bidirectional action for movement left or right (i.e. horizontal).
Definition: PlayerManager.h:57
QList< int > getAvailablePlayers() const
Returns the list of currently available players (i.e. players currently connected with a controller)...
Definition: PlayerManager.h:81
Unidirectional action for movement to the right.
Definition: PlayerManager.h:53
bool isMagnetized(int player) const
Returns whether or not the the player has magnetism activated.
Unidirectional action for movement to the left.
Definition: PlayerManager.h:49
VirtualController * getPlayerController(int player) const
Returns the VirtualController for player.