mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-07 10:34:46 -04:00
parent
084c01c5b7
commit
0916f1dd61
1 changed files with 2 additions and 2 deletions
|
@ -11,8 +11,8 @@ class Vector
|
|||
apiProperties: ['x', 'y', 'z', 'magnitude', 'heading', 'distance', 'dot', 'equals', 'copy', 'distanceSquared', 'rotate']
|
||||
|
||||
constructor: (x=0, y=0, z=0) ->
|
||||
return new Vector(x,y,z) unless this instanceof Vector
|
||||
[@x, @y, @z] = [x,y,z]
|
||||
return new Vector x, y, z unless @ instanceof Vector
|
||||
[@x, @y, @z] = [x, y, z]
|
||||
|
||||
copy: ->
|
||||
new Vector(@x, @y, @z)
|
||||
|
|
Loading…
Add table
Reference in a new issue