game: add: class: point and segment, add: type docstring

This commit is contained in:
2024-01-21 00:33:30 +01:00
parent 6f8768e149
commit 8da7e09af7
19 changed files with 478 additions and 125 deletions

View File

@ -0,0 +1,30 @@
class Point
{
/**
* @param {Number} x
* @param {Number} y
*/
constructor(x, y)
{
/**
* @type {Number}
*/
this.x = x;
/**
* @type {Number}
*/
this.y = y;
}
from_json(data)
{
this.x = data.x
this.y = data.y
return this
}
}
export { Point }