Module: Api::UnitTypeDataExtension

Included in:
UnitTypeData
Defined in:
lib/sc2ai/protocol/extensions/unit_type_data.rb

Overview

Adds additional functionality to message object Api::UnitTypeData

Instance Attribute Summary collapse

Instance Attribute Details

#mineral_cost_sumInteger

Sum of all morphs mineral cost i.e. 550M Orbital command = 400M CC + 150M Upgrade i.e. 350M Hatchery = 50M Drone + 300M Build

Returns:

  • (Integer)

    sum of mineral costs



11
12
13
# File 'lib/sc2ai/protocol/extensions/unit_type_data.rb', line 11

def mineral_cost_sum
  @mineral_cost_sum
end

#placement_lengthInteger

Length of tiles to build. i.e. 5 for any Base-type (5x5) i.e. 3 for Barracks (3x3) i.e. 2 for Supply Depot (2x2)

Returns:

  • (Integer)

    side-length for placement



25
26
27
# File 'lib/sc2ai/protocol/extensions/unit_type_data.rb', line 25

def placement_length
  @placement_length
end

#vespene_cost_sumInteger

Sum of all morphs vespene gas cost i.e. 250G Broodlord = 100G Corruptor + 150G Morph

Returns:

  • (Integer)

    sum of vespene gas costs



17
18
19
# File 'lib/sc2ai/protocol/extensions/unit_type_data.rb', line 17

def vespene_cost_sum
  @vespene_cost_sum
end