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:

1. Core

Some important core classes used inside Haxball.

1.1. H

Point class.

1.1.1. Properties

  • x: number: The x coordinate of the point.
  • y: number: The y coordinate of the point.

1.2. ka

TeamColors class.

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.

1.3. p

Team class

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 is Team.byId = [Team.spec, Team.red, Team.blue].

1.3.2. Properties

  • rival: Team: The rival of current Team object.
  • id: int: The id of current Team object.
  • color: int: The numeric color value of current Team object.
  • name: string: The name of current Team object.
  • colors: TeamColors: Object that stores custom color values to render striped team colors.
  • className: string: Name of the class for HTML elements. Can be either "t-spec", "t-red", or "t-blue".

1.4. T

GeoLocation class

1.4.1. Properties

  • flag: string: Two-letter country code.
  • lon: number: Longitude
  • lat: number: Latitude

2. Stream

These classes are used to read/write data from/to replay files and/or network/WebRTC stream.

2.1. F

StreamReader class

2.2. w

StreamWriter class

3. Utils

Some utility classes. (All of them may not be necessarily useful but still, why not export them?)

3.1. U

String operations 1

3.2. D

String operations 2

3.3. J

String operations 3

3.4. K

String operations 4

3.5. r

Mostly used for object casting

3.6. M

Webserver api operations

3.7. n

Connection constants

3.8. va

RoomList operations

3.9. q

Haxball's original global error class