interfaces impl - wxyz-abcd/node-haxball GitHub Wiki
Impl
Implementation of Haxball's inner classes. Some important classes are exported through this object.
The explanations will be cut short, vague and sometimes partially ambiguous here; and only some of the properties of classes will be explored due to the potentially harmful nature of explaining these in detail.
The classes are put into 3 categories for now:
Core
1. Some important core classes used inside Haxball.
Point
1.1. The Point class that is used internally inside the game's physics engine.
1.1.1. Properties
x: number
: The x coordinate of the point.y: number
: The y coordinate of the point.
TeamColors
1.2. The class that defines the colors of a team.
1.2.1. Properties
angle: number
: The angle of stripes rendered inside a player.text: int
: The numeric color of the avatar text rendered inside a player.inner: int[]
: The numeric colors of each stripe rendered inside a player.
Team
1.3. The class that defines the properties of a team.
1.3.1. Static objects
spec: Team
: The static spectators team.red: Team
: The static red team.blue: Team
: The static blue team.byId: Team[]
: A static array to get all teams using their ids. Its definition isTeam.byId = [Team.spec, Team.red, Team.blue]
.
1.3.2. Properties
id: int
: The id of current Team object.color: int
: The numeric color value of current Team object.
Stream
2. These classes are used to read/write data from/to replay files and/or network/WebRTC stream.
Reader
2.1. StreamReader class
Writer
2.2. StreamWriter class