Module: Api::DebugGameState

Defined in:
lib/sc2ai/protocol/debug_pb.rb

Constant Summary collapse

ENUM_DEBUG_GAME_STATE_UNSET =
0
SHOW_MAP =
1
CONTROL_ENEMY =
2
FOOD =
3
FREE =
4
ALL_RESOURCES =
5
GOD =
6
MINERALS =
7
GAS =
8
COOLDOWNS =
9
TECH_TREE =
10
UPGRADE =
11
FAST_BUILD =
12

Class Method Summary collapse

Class Method Details

.lookup(val) ⇒ Object



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
49
# File 'lib/sc2ai/protocol/debug_pb.rb', line 21

def self.lookup(val)
  if val == 0
    :ENUM_DEBUG_GAME_STATE_UNSET
  elsif val == 1
    :SHOW_MAP
  elsif val == 2
    :CONTROL_ENEMY
  elsif val == 3
    :FOOD
  elsif val == 4
    :FREE
  elsif val == 5
    :ALL_RESOURCES
  elsif val == 6
    :GOD
  elsif val == 7
    :MINERALS
  elsif val == 8
    :GAS
  elsif val == 9
    :COOLDOWNS
  elsif val == 10
    :TECH_TREE
  elsif val == 11
    :UPGRADE
  elsif val == 12
    :FAST_BUILD
  end
end

.resolve(val) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/sc2ai/protocol/debug_pb.rb', line 51

def self.resolve(val)
  if val == :ENUM_DEBUG_GAME_STATE_UNSET
    0
  elsif val == :SHOW_MAP
    1
  elsif val == :CONTROL_ENEMY
    2
  elsif val == :FOOD
    3
  elsif val == :FREE
    4
  elsif val == :ALL_RESOURCES
    5
  elsif val == :GOD
    6
  elsif val == :MINERALS
    7
  elsif val == :GAS
    8
  elsif val == :COOLDOWNS
    9
  elsif val == :TECH_TREE
    10
  elsif val == :UPGRADE
    11
  elsif val == :FAST_BUILD
    12
  end
end