Module: Api::CloakState

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

Constant Summary collapse

CLOAKED_UNKNOWN =
0
CLOAKED =
1
CLOAKED_DETECTED =
2
NOT_CLOAKED =
3
CLOAKED_ALLIED =
4

Class Method Summary collapse

Class Method Details

.lookup(val) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/sc2ai/protocol/raw_pb.rb', line 59

def self.lookup(val)
  return :CLOAKED_UNKNOWN if val == 0
  return :CLOAKED if val == 1
  return :CLOAKED_DETECTED if val == 2
  return :NOT_CLOAKED if val == 3
  return :CLOAKED_ALLIED if val == 4
end

.resolve(val) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/sc2ai/protocol/raw_pb.rb', line 67

def self.resolve(val)
  return 0 if val == :CLOAKED_UNKNOWN
  return 1 if val == :CLOAKED
  return 2 if val == :CLOAKED_DETECTED
  return 3 if val == :NOT_CLOAKED
  return 4 if val == :CLOAKED_ALLIED
end