Method: Api::SpatialCameraSetup#as_json

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

#as_json(options = {}) ⇒ Object



39287
39288
39289
39290
39291
39292
39293
39294
39295
39296
39297
39298
39299
39300
39301
39302
39303
39304
39305
39306
39307
39308
39309
39310
39311
39312
39313
# File 'lib/sc2ai/protocol/sc2api_pb.rb', line 39287

def as_json(options = {})
  result = {}

  result["width"] = @width if !options[:compact] || has_width?
  result["resolution"] = (
    if @resolution.nil?
      {}
    else
      @resolution.as_json(options)
    end
  ) if !options[:compact] || has_resolution?
  result["minimapResolution"] = (
    if @minimap_resolution.nil?
      {}
    else
      @minimap_resolution.as_json(options)
    end
  ) if !options[:compact] || has_minimap_resolution?
  result["cropToPlayableArea"] = @crop_to_playable_area if !options[
    :compact
  ] || has_crop_to_playable_area?
  result["allowCheatingLayers"] = @allow_cheating_layers if !options[
    :compact
  ] || has_allow_cheating_layers?

  result
end