wire_protocol.fbs 698 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. namespace wire_protocol;
  2. enum Command : short {
  3. ShiftLeft = 0,
  4. ShiftRight = 1,
  5. Rotate = 2,
  6. Down = 3,
  7. Land = 4,
  8. GetGameState = 5,
  9. }
  10. enum CommandResponseError : short {
  11. OK = 0,
  12. INVALID_COMMAND = 1,
  13. UNKNOWN_COMMAND = 2,
  14. }
  15. table CommandRequest {
  16. command:Command;
  17. }
  18. table Playfield {
  19. rows:short;
  20. cols:short;
  21. cells:[ubyte];
  22. }
  23. table GameState {
  24. rows:short;
  25. cols:short;
  26. next_piece:short;
  27. current_piece:short;
  28. piece_rotation:short;
  29. piece_row:short;
  30. piece_col:short;
  31. score:short;
  32. millis_before_down:short;
  33. grid:[ubyte];
  34. }
  35. table CommandResponse {
  36. error:CommandResponseError;
  37. game_state:GameState;
  38. }
  39. root_type CommandRequest;
  40. root_type CommandResponse;