| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- namespace wire_protocol;
- enum Command : short {
- StartGame = 0,
- ShiftLeft = 1,
- ShiftRight = 2,
- Rotate = 3,
- Down = 4,
- Land = 5,
- GetGameState = 6,
- }
- enum CommandResponseError : short {
- OK = 0,
- INVALID_COMMAND = 1,
- UNKNOWN_COMMAND = 2,
- GAME_OVER = 3,
- }
- table CommandRequest {
- command:Command;
- }
- table Playfield {
- rows:short;
- cols:short;
- cells:[ubyte];
- }
- table GameState {
- rows:short;
- cols:short;
- next_piece:short;
- current_piece:short;
- piece_rotation:short;
- piece_row:short;
- piece_col:short;
- score:short;
- millis_before_down:short;
- grid:[ubyte];
- }
- table CommandResponse {
- error:CommandResponseError;
- game_state:GameState;
- }
- root_type CommandRequest;
- root_type CommandResponse;
|