Skip to content

Commit

Permalink
missing generics type parameter documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lusito committed Nov 8, 2017
1 parent 47eec67 commit 397a3e5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class Engine {
/**
* Adds the EntitySystem to this Engine.
*
* @typeparam T The entity system class
* @param system The EntitySystem to add
*/
public addSystem<T extends EntitySystem>(system: T): T {
Expand Down Expand Up @@ -285,10 +286,11 @@ export class Engine {
/**
* Quick EntitySystem retrieval.
*
* @typeparam T The entity system class
* @param clazz The EntitySystem class
* @return The EntitySystem of the specified class, or null if no such system exists.
*/
public getSystem<T extends EntitySystem>(clazz: Constructor<EntitySystem>): T | null {
public getSystem<T extends EntitySystem>(clazz: Constructor<T>): T | null {
let type = UniqueType.getForClass(clazz);
let index = type.getIndex();
return <T>this.systemsByType[index] || null;
Expand Down
2 changes: 2 additions & 0 deletions src/core/Entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class Entity {
/**
* Add a component. This will be freed on removal. Prefer add() instead
*
* @typeparam T The component class
* @param component the component to add
* @return The added component
*/
Expand Down Expand Up @@ -91,6 +92,7 @@ export class Entity {
/**
* Retrieve a Component from this Entity by class.
*
* @typeparam T The component class
* @param clazz The Component class
* @return The instance of the specified Component attached to this Entity, or null if no such Component exists.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/utils/DelayedOperationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class DelayedOperation<T> {

/**
* The callback to actually perform the add/remove/removeAll operations.
*
* @typeparam T The entry class
*/
export interface DelayedOperationHandlerListener<T> {
/**
Expand All @@ -53,6 +55,8 @@ export interface DelayedOperationHandlerListener<T> {

/**
* A class to help delaying add/remove/removeAll operations during engine updates.
*
* @typeparam T The entry class
*/
export class DelayedOperationHandler<T> {
private nextOperation: DelayedOperation<T> | null = null;
Expand Down
5 changes: 5 additions & 0 deletions src/utils/Lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class Lookup {
/**
* Store an instance of a class
*
* @typeparam T The class used to get the instance later.
* @typeparam I The class of the instance.
* @param clazz The class used to get the instance later.
* @param instance The instance to store.
*/
Expand All @@ -38,6 +40,7 @@ export class Lookup {
/**
* Get an instance of a class
*
* @typeparam T The class the instance was bound to.
* @param clazz The class the instance was bound to.
*/
public get<T>(clazz: Constructor<T>): T | null {
Expand All @@ -48,6 +51,7 @@ export class Lookup {
/**
* Check if an instance of the specified class exists.
*
* @typeparam T The class the instance was bound to.
* @param clazz The class the instance was bound to.
*/
public has<T>(clazz: Constructor<T>): boolean {
Expand All @@ -58,6 +62,7 @@ export class Lookup {
/**
* Remove an instance of a class
*
* @typeparam T The class the instance was bound to.
* @param clazz The class the instance was bound to.
*/
public remove<T>(clazz: Constructor<T>) {
Expand Down

0 comments on commit 397a3e5

Please sign in to comment.