Module: Api::Result

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

Constant Summary collapse

ENUM_RESULT_UNSET =
0
VICTORY =
1
DEFEAT =
2
TIE =
3
UNDECIDED =
4

Class Method Summary collapse

Class Method Details

.lookup(val) ⇒ Object



212
213
214
215
216
217
218
# File 'lib/sc2ai/protocol/sc2api_pb.rb', line 212

def self.lookup(val)
  return :ENUM_RESULT_UNSET if val == 0
  return :VICTORY if val == 1
  return :DEFEAT if val == 2
  return :TIE if val == 3
  return :UNDECIDED if val == 4
end

.resolve(val) ⇒ Object



220
221
222
223
224
225
226
# File 'lib/sc2ai/protocol/sc2api_pb.rb', line 220

def self.resolve(val)
  return 0 if val == :ENUM_RESULT_UNSET
  return 1 if val == :VICTORY
  return 2 if val == :DEFEAT
  return 3 if val == :TIE
  return 4 if val == :UNDECIDED
end