Big Tony
BigTony.Core.BaseSystem< T > Class Template Reference

Public Member Functions

void Register (T entity)
 Adds an entity into the system. More...
 
void Unregister (T entity)
 Removes an entity from the system. More...
 
List< T > Slice (int start)
 Get a segment of the entity list from 'start' until the end of the entities list. More...
 
List< T > Slice (int start, int end)
 Get a segment of the entity list from the 'start' index until the 'end' index. More...
 
Pop ()
 Removes the top entity from the stack and returns it. More...
 
Shift ()
 Removes the bottom entity from the stack and returns it. More...
 
Top ()
 Returns the top entity from the stack. More...
 
Bottom ()
 Returns the bottom entity from the stack. More...
 
int GetEntityCount ()
 Get the number of entities currently in the system. More...
 
virtual void OnRegister (T entity)
 This is run when a new entity is created. More...
 
virtual void OnUnregister (T entity)
 This is run when a new entity is created. More...
 
virtual void OnUpdate ()
 This is run every frame by the server. More...
 

Static Public Attributes

static List< T > entities = new List<T>()
 

Member Function Documentation

◆ Bottom()

T BigTony.Core.BaseSystem< T >.Bottom ( )
inline

Returns the bottom entity from the stack.

Returns
The bottom entity on the stack.

◆ GetEntityCount()

int BigTony.Core.BaseSystem< T >.GetEntityCount ( )
inline

Get the number of entities currently in the system.

Returns
The integer representation of the number of entities in the system.

◆ OnRegister()

virtual void BigTony.Core.BaseSystem< T >.OnRegister ( entity)
inlinevirtual

This is run when a new entity is created.

◆ OnUnregister()

virtual void BigTony.Core.BaseSystem< T >.OnUnregister ( entity)
inlinevirtual

This is run when a new entity is created.

◆ OnUpdate()

virtual void BigTony.Core.BaseSystem< T >.OnUpdate ( )
inlinevirtual

This is run every frame by the server.

Reimplemented in BigTony.Examples.PlayerSystem, and BigTony.Examples.BulletSystem.

◆ Pop()

T BigTony.Core.BaseSystem< T >.Pop ( )
inline

Removes the top entity from the stack and returns it.

Returns
The top entity on the stack.

◆ Register()

void BigTony.Core.BaseSystem< T >.Register ( entity)
inline

Adds an entity into the system.

Parameters
entityThe entity to be added into the system.

◆ Shift()

T BigTony.Core.BaseSystem< T >.Shift ( )
inline

Removes the bottom entity from the stack and returns it.

Returns
The bottom entity on the stack.

◆ Slice() [1/2]

List<T> BigTony.Core.BaseSystem< T >.Slice ( int  start)
inline

Get a segment of the entity list from 'start' until the end of the entities list.

Parameters
startThe start of the query.
Returns
A list filled with entities between the range 'start' and end of the entities list.

◆ Slice() [2/2]

List<T> BigTony.Core.BaseSystem< T >.Slice ( int  start,
int  end 
)
inline

Get a segment of the entity list from the 'start' index until the 'end' index.

Parameters
startThe start of the query.
endThe end of the query.
Returns
A list filled with entities between the range 'start' and 'end'.

◆ Top()

T BigTony.Core.BaseSystem< T >.Top ( )
inline

Returns the top entity from the stack.

Returns
The top entity on the stack.

◆ Unregister()

void BigTony.Core.BaseSystem< T >.Unregister ( entity)
inline

Removes an entity from the system.

Parameters
entityThe entity to be removed from the system.

Member Data Documentation

◆ entities

List<T> BigTony.Core.BaseSystem< T >.entities = new List<T>()
static