namespace wire_protocol; enum Command : short { ShiftLeft = 0, ShiftRight = 1, Rotate = 2, Land = 3, GetGameState = 4, } enum CommandResponseError : short { OK = 0, INVALID_COMMAND = 1, UNKNOWN_COMMAND = 2, } 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; grid:[ubyte]; } table CommandResponse { error:CommandResponseError; game_state:GameState; } root_type CommandRequest; root_type CommandResponse;