15 #ifndef MULTIPLAYER_DIRECTOR_H_
16 #define MULTIPLAYER_DIRECTOR_H_
20 #include "controller.h"
21 #include "game_state.h"
22 #include "multiplayer_controller.h"
23 #include "multiplayer_generated.h"
24 #include "pie_noon_game.h"
26 #ifdef PIE_NOON_USES_GOOGLE_PLAY_GAMES
27 #include "gpg_multiplayer.h"
47 void Initialize(
GameState *gamestate_ptr,
const Config *config);
48 #ifdef PIE_NOON_USES_GOOGLE_PLAY_GAMES
51 gpg_multiplayer_ = gpg_multiplayer;
58 void AdvanceFrame(WorldTime delta_time);
68 void SetDebugInputSystem(fplbase::InputSystem *input) {
69 debug_input_system_ = input;
72 #ifdef PIE_NOON_USES_GOOGLE_PLAY_GAMES
74 void SendPlayerAssignmentMsg(
const std::string &instance, CharacterId
id);
76 void SendStartTurnMsg(
unsigned int turn_seconds);
78 void SendEndGameMsg();
80 void SendPlayerStatusMsg();
84 void set_seconds_per_turn(
unsigned int seconds) {
85 seconds_per_turn_ = seconds;
88 unsigned int seconds_per_turn() {
return seconds_per_turn_; }
92 unsigned int turn_number() {
return turn_number_; }
95 void InputPlayerCommand(CharacterId
id,
96 const multiplayer::PlayerCommand &command);
101 void TriggerPlayerHitByPie(CharacterId player,
int damage);
104 bool IsAIPlayer(CharacterId player);
107 WorldTime turn_timer() {
return turn_timer_; }
109 WorldTime start_turn_timer() {
return start_turn_timer_; }
112 void set_num_ai_players(
unsigned int n) { num_ai_players_ = n; }
113 unsigned int num_ai_players()
const {
return num_ai_players_; }
120 Command() : aim_at(-1), is_firing(
false), is_blocking(
false) {}
123 void TriggerStartOfTurn();
124 void TriggerEndOfTurn();
125 unsigned int CalculateSecondsPerTurn(
unsigned int turn_number);
128 std::vector<uint8_t> ReadPlayerHealth();
131 void ChooseAICommand(CharacterId
id);
133 void DebugInput(fplbase::InputSystem *input);
136 std::vector<uint8_t> ReadPlayerSplats();
139 const Config *config_;
141 std::vector<MultiplayerController *> controllers_;
142 std::vector<uint8_t> character_splats_;
144 WorldTime turn_timer_;
146 WorldTime start_turn_timer_;
147 unsigned int seconds_per_turn_;
148 unsigned int turn_number_;
150 unsigned int num_ai_players_;
152 fplbase::InputSystem *debug_input_system_;
154 std::vector<Command> commands_;
156 #ifdef PIE_NOON_USES_GOOGLE_PLAY_GAMES
166 #endif // MULTIPLAYER_DIRECTOR_H_
Definition: multiplayer_controller.h:32
Definition: game_state.h:56
Definition: gpg_multiplayer.h:63
Definition: multiplayer_director.h:42