Grids
This class is another version of the grid generation system in the client side. It's used to simplify location of all the entities in the world.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
entityGrid: *[] |
|
public |
map: * |
Method Summary
Public Methods | ||
public |
addToEntityGrid(entity: *, x: *, y: *) |
|
public |
checkBounds(x: *, y: *, radius: *): * |
|
public |
getSurroundingEntities(entity: *, radius: *, include: *): * |
|
public |
loadGrid() |
|
public |
removeFromEntityGrid(entity: *, x: *, y: *) |
|
public |
updateEntityPosition(entity: *) |
Public Constructors
public constructor() source
Public Methods
public addToEntityGrid(entity: *, x: *, y: *) source
Params:
Name | Type | Attribute | Description |
entity | * | ||
x | * | ||
y | * |
public checkBounds(x: *, y: *, radius: *): * source
Params:
Name | Type | Attribute | Description |
x | * | ||
y | * | ||
radius | * |
Return:
* |
public getSurroundingEntities(entity: *, radius: *, include: *): * source
Params:
Name | Type | Attribute | Description |
entity | * | ||
radius | * | ||
include | * |
Return:
* |
public loadGrid() source
public removeFromEntityGrid(entity: *, x: *, y: *) source
Params:
Name | Type | Attribute | Description |
entity | * | ||
x | * | ||
y | * |
public updateEntityPosition(entity: *) source
Params:
Name | Type | Attribute | Description |
entity | * |