Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/sc2ai/overrides/array.rb
Overview
Array extensions
Instance Method Summary collapse
-
#to_p2d ⇒ Api::Point2D
Creates a Point2D from 0,1 as x,y.
-
#to_unit_group ⇒ Sc2::UnitGroup
Turns an Array of Api::Unit into a Sc2::UnitGroup.
Instance Method Details
#to_p2d ⇒ Api::Point2D
Creates a Point2D from 0,1 as x,y
11 12 13 |
# File 'lib/sc2ai/overrides/array.rb', line 11 def to_p2d Api::Point2D.new(x: at(0), y: at(1)) end |
#to_unit_group ⇒ Sc2::UnitGroup
Turns an Array of Api::Unit into a Sc2::UnitGroup
5 6 7 |
# File 'lib/sc2ai/overrides/array.rb', line 5 def to_unit_group Sc2::UnitGroup.new(self) end |