Module: Api::Race

Defined in:
lib/sc2ai/protocol/_meta_documentation.rb,
lib/sc2ai/protocol/common_pb.rb

Overview

PROTOBUF VIRTUAL ENUM.

Constant Summary collapse

NO_RACE =
0
TERRAN =
1
ZERG =
2
PROTOSS =
3
RANDOM =
4

Class Method Summary collapse

Class Method Details

.lookup(val) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sc2ai/protocol/common_pb.rb', line 13

def self.lookup(val)
  if val == 0
    :NO_RACE
  elsif val == 1
    :TERRAN
  elsif val == 2
    :ZERG
  elsif val == 3
    :PROTOSS
  elsif val == 4
    :RANDOM
  end
end

.resolve(val) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sc2ai/protocol/common_pb.rb', line 27

def self.resolve(val)
  if val == :NO_RACE
    0
  elsif val == :TERRAN
    1
  elsif val == :ZERG
    2
  elsif val == :PROTOSS
    3
  elsif val == :RANDOM
    4
  end
end