Module: Api::AbilityRemapable

Included in:
ActionError, ActionRawToggleAutocast, ActionRawUnitCommand, ActionSpatialUnitCommand, ActionToggleAutocast, AvailableAbility, BuildItem, UnitOrder
Defined in:
lib/sc2ai/protocol/extensions/ability_remapable.rb

Overview

This module make sure that a read from method ability_id always returns the proper source id

Instance Method Summary collapse

Instance Method Details

#ability_idInteger

Ability Id. The generic id or “remapid”. i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK

Returns:

  • (Integer)


7
8
9
# File 'lib/sc2ai/protocol/extensions/ability_remapable.rb', line 7

def ability_id
  @ability_id ||= Api::AbilityId.generic_id(send(:method_missing, :ability_id))
end