Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed Apr 27, 2024
2 parents fe70f11 + e6527d6 commit 5db5261
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/decorators/CharacterDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,15 @@ export function getCharacterById<T extends CharacterBaseModel>(id: string): T |
return
}
}

/**
* is a function that returns all characters
* @returns all characters
* @example
* ```typescript
* const allCharacters = getAllCharacters();
* ```
*/
export function getAllCharacters<T extends CharacterBaseModel>(): T[] {
return Object.values(registeredCharacters) as T[]
}
2 changes: 1 addition & 1 deletion src/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { default as canvasElementDecorator } from './CanvasElementDecorator';
export { getCharacterById, saveCharacter } from './CharacterDecorator';
export { getAllCharacters, getCharacterById, saveCharacter } from './CharacterDecorator';
export { default as eventDecorator } from './EventDecorator';
export { default as labelDecorator } from './LabelDecorator';
export { default as tickerDecorator } from './TickerDecorator';
Expand Down

0 comments on commit 5db5261

Please sign in to comment.