new Necrowar.Game()
Initializes a Game with basic logic as provided by the Creer code generator.
Never use this directly. It is for internal Joueur use.
Extends
- BaseGame
Members
-
Necrowar.Player currentPlayer
-
The player whose turn it is currently. That player can send commands. Other players cannot.
-
number currentTurn
-
The current turn number, starting at 0 for the first player's turn.
-
Object.<string, Necrowar.GameObject> gameObjects
-
A mapping of every game object's ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.
-
number goldIncomePerUnit
-
The amount of gold income per turn per unit in a mine.
-
number islandIncomePerUnit
-
The amount of gold income per turn per unit in the island mine.
-
number manaIncomePerUnit
-
The Amount of gold income per turn per unit fishing on the river side.
-
number mapHeight
-
The number of Tiles in the map along the y (vertical) axis.
-
number mapWidth
-
The number of Tiles in the map along the x (horizontal) axis.
-
number maxTurns
-
The maximum number of turns before the game will automatically end.
-
string name
-
The name of the game.
-
Array.<Necrowar.Player> players
-
List of all the players in the game.
-
number riverPhase
-
The amount of turns it takes between the river changing phases.
-
string session
-
A unique identifier for the game instance that is being played.
-
Array.<Necrowar.Tile> tiles
-
All the tiles in the map, stored in Row-major order. Use `x + y * mapWidth` to access the correct index.
-
number timeAddedPerTurn
-
The amount of time (in nano-seconds) added after each player performs a turn.
-
Array.<Necrowar.TowerJob> towerJobs
-
A list of every tower type / job.
-
Array.<Necrowar.Tower> towers
-
Every Tower in the game.
-
Array.<Necrowar.UnitJob> unitJobs
-
A list of every unit type / job.
-
Array.<Necrowar.Unit> units
-
Every Unit in the game.
Methods
-
Tile | null getTileAt(x, y)
-
Gets the Tile at a specified (x, y) position
Name Type Description x
number integer between 0 and the mapWidth y
number integer between 0 and the mapHeight Returns: Tile | null
the Tile at (x, y) or null if out of bounds