~starkingdoms/starkingdoms

ref: f73656c66fcec95e0957a7500c291926e0dcab2e starkingdoms/client/src/protocol/input.ts -rw-r--r-- 944 bytes
f73656c6 — core the server currently does much nothing 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//@ts-nocheck

export const protobufPackage = "protocol.input";

export enum InputType {
  UNKNOWN = 0,
  Left = 1,
  Middle = 2,
  Right = 3,
  UNRECOGNIZED = -1,
}

export function inputTypeFromJSON(object: any): InputType {
  switch (object) {
    case 0:
    case "UNKNOWN":
      return InputType.UNKNOWN;
    case 1:
    case "Left":
      return InputType.Left;
    case 2:
    case "Middle":
      return InputType.Middle;
    case 3:
    case "Right":
      return InputType.Right;
    case -1:
    case "UNRECOGNIZED":
    default:
      return InputType.UNRECOGNIZED;
  }
}

export function inputTypeToJSON(object: InputType): string {
  switch (object) {
    case InputType.UNKNOWN:
      return "UNKNOWN";
    case InputType.Left:
      return "Left";
    case InputType.Middle:
      return "Middle";
    case InputType.Right:
      return "Right";
    case InputType.UNRECOGNIZED:
    default:
      return "UNRECOGNIZED";
  }
}