ProtectedconstructorThe protected constructor
The x non-negative integer number
The y non-negative integer number
Protected_The x non-negative integer number
Protected_The y non-negative integer number
The x getter
The x non-negative integer number
The y getter
The y non-negative integer number
ProtectedresetReset the initial default values (0,0)
The x setter
The x non-negative integer ("stringified") number
protected _x class memberThe y setter
The y non-negative integer ("stringified") number
protected _y class memberGet the coordinates as array [x,y]
the coordinates as array [x,y]. Ex: [3,4]
Get the coordinates in string format separated by a separator
the separator of the stringified coordinates. Default '-'
the stringified version of the coordinates. Ex: '2-7'
StaticarrayUtility function to transform an array of coordinates [x,y] into its "stringified" version 'x-y' based on the value of the separator (which defaults to '-').
the array of coordinates [x,y]. Ex: [2,7]
the separator of the stringified coordinates in output
Protected StaticcheckUtility static method to check that the 'val' in input in a non-negative integer number, or a "stringified" non-negative integer which will be transformed into a number
the input which can be a string or a number
StaticfromBuild a Coordinates class instance from array coordinates [x,y]
the array of coordinates [x,y]. Ex: [5,1]
StaticfromBuild a Coordinates class instance from string coordinates 'x-y'
the stringified coordinates. Ex: '4-7'
the separator of the stringified coordinates. Default '-'
StaticstringUtility function to transform a stringified coordinates 'x-y' into the array of coordinates [x,y]
the stringified coordinates. Ex: '4-7'
the separator of the stringified coordinates. Default '-'
Coordinates is the class representing the 2-Dimension coordinates (x,y)