Module: Api::PlayerType

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

Overview

PROTOBUF VIRTUAL ENUM.

Constant Summary collapse

ENUM_PLAYER_TYPE_UNSET =
0
PARTICIPANT =
1
COMPUTER =
2
OBSERVER =
3

Class Method Summary collapse

Class Method Details

.lookup(val) ⇒ Object



127
128
129
130
131
132
133
134
135
136
137
# File 'lib/sc2ai/protocol/sc2api_pb.rb', line 127

def self.lookup(val)
  if val == 0
    :ENUM_PLAYER_TYPE_UNSET
  elsif val == 1
    :PARTICIPANT
  elsif val == 2
    :COMPUTER
  elsif val == 3
    :OBSERVER
  end
end

.resolve(val) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/sc2ai/protocol/sc2api_pb.rb', line 139

def self.resolve(val)
  if val == :ENUM_PLAYER_TYPE_UNSET
    0
  elsif val == :PARTICIPANT
    1
  elsif val == :COMPUTER
    2
  elsif val == :OBSERVER
    3
  end
end