docs
This commit is contained in:
@@ -6,51 +6,51 @@ class GamesManager{
|
||||
name = 'games';
|
||||
|
||||
/**
|
||||
* Class initializer
|
||||
* @param {App} app Class initializer
|
||||
* Class initializer, инициализация на плъгин
|
||||
* @param {App} app Class initializer, основна апликация
|
||||
*/
|
||||
init(app){
|
||||
const {db} = app;
|
||||
|
||||
/**
|
||||
* Creates a new game definition
|
||||
* @param {Context} ctx Request context
|
||||
* @param {Game} data the game description
|
||||
* Creates a new game definition, създаване на нова игрова дефиниция
|
||||
* @param {Context} ctx Request context, контекст на заявката
|
||||
* @param {Game} data the game description, дефиниция на играта
|
||||
*/
|
||||
this.create = async function(ctx, data){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads game definition by ID
|
||||
* @param {Number} id game ID
|
||||
* @returns {Game} the game
|
||||
* Reads game definition by ID, извличане на игрова дефиниция от базата от данни по подаден идентификатор
|
||||
* @param {Number} id game ID, идентификатор на играта
|
||||
* @returns {Game} the game, игрова дефиниция
|
||||
*/
|
||||
this.read = async function(id){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates game definition
|
||||
* @param {Context} ctx Request context
|
||||
* @param {Game} data the game description
|
||||
* Updates game definition, обновяване на игрова дефиниция
|
||||
* @param {Context} ctx Request context, контекст на заявката
|
||||
* @param {Game} data the game description, игрова дефиниция
|
||||
*/
|
||||
this.update = async function(ctx, data){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes game by ID
|
||||
* @param {Number} id game definition ID
|
||||
* Removes game by ID, изтриване на игрова дефиниция по зададен идентификатор
|
||||
* @param {Number} id game definition ID, идентификатор на игровата дефиниция
|
||||
*/
|
||||
this.remove = async function(id){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a set of games by given criteria
|
||||
* @param {Query} query criteria
|
||||
* @returns {Game[]} Array of games
|
||||
* Returns a set of games by given criteria, търсене в игровите дефиниции по зададени критерии
|
||||
* @param {Query} query criteria, критерии за търсене - заявка към базата от данни
|
||||
* @returns {Game[]} Array of games, масив от игрови дефиниции
|
||||
*/
|
||||
this.list = async function(query){
|
||||
|
||||
@@ -60,7 +60,7 @@ class GamesManager{
|
||||
|
||||
/**
|
||||
* Class starter
|
||||
* @param {App} app The application
|
||||
* @param {App} app The application, основна апликация
|
||||
*/
|
||||
async start(app){
|
||||
|
||||
@@ -68,17 +68,17 @@ class GamesManager{
|
||||
}
|
||||
|
||||
/**
|
||||
* Game entity
|
||||
* Game entity, игрова дефиниция - елемент
|
||||
*/
|
||||
class Game {
|
||||
/**
|
||||
* Game name
|
||||
* Game name, име на играта
|
||||
* @type {string}
|
||||
*/
|
||||
name = null;
|
||||
|
||||
/**
|
||||
* Game scenario
|
||||
* Game scenario, сценарий на играта
|
||||
* @type { Scenario }
|
||||
*/
|
||||
scenario = null;
|
||||
|
||||
Reference in New Issue
Block a user