syntax = "proto3";

message Card {
  int32 face_val = 1;
  int32 suit = 2;
}

message Hand {
  repeated Card card = 1;
}

message Player {
  string nick = 1;
  int32 id = 2;
  Hand hand = 3;
  int32 coins = 4;
  bool in = 5;
  bool winner = 6;
  bool is_connected = 7;
}

message GameState {
  uint32 pot = 1;
  int32 dealer_id = 2;
  bool at_menu = 3;
  uint32 player_count = 4;
  uint32 raises_remaining = 5;
  uint32 prev_bet_amount = 6;
  bool winner_declared = 7;
  bool player_exchanging = 8;
  repeated Player player = 9;
}

message GameSettings {
  int32 client_id = 1;
  uint32 action_timeout_ms = 2;
  uint32 wild_exchange_timeout_ms = 3;
  uint32 end_of_game_timeout_ms = 4;
  uint32 bet_minimum = 5;
  uint32 bet_median = 6;
  uint32 bet_maximum = 7;
}

enum MessageType {
  MSG_PING_REQUEST = 0;
  MSG_PING_RESPONSE = 1;
  MSG_PING_BROADCAST = 2;
}

message PingRequest {
  uint32 timestamp = 1; // SDL_GetTicks() when sent
}

message PingResponse {
  uint32 timestamp = 1; // Echo timestamp from request
}

message PingEntry {
  uint32 player_id = 1;
  uint32 ping_ms = 2;
}

message PingBroadcast {
  repeated PingEntry entries = 1;
}
