Module: Api::Point2DExtension::ClassMethods

Included in:
Api::Point2D
Defined in:
lib/sc2ai/protocol/extensions/point_2_d.rb

Overview

Adds additional functionality to message class Api::Point2D

Instance Method Summary collapse

Instance Method Details

#[](x, y) ⇒ Api::Point2D

Shorthand for creating an instance for [x, y]

Examples:

Api::Point2D[2,4] # Where x is 2.0 and y is 4.0

Returns:



29
30
31
# File 'lib/sc2ai/protocol/extensions/point_2_d.rb', line 29

def [](x, y)
  Api::Point2D.new(x: x, y: y)
end