docs
This commit is contained in:
+27
-27
@@ -2,7 +2,7 @@ import path, { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
/**
|
||||
* Main backend application class
|
||||
* Main backend application class, апликация - основен клас на сървърното приложение
|
||||
*/
|
||||
class App{
|
||||
constructor(){
|
||||
@@ -11,13 +11,13 @@ class App{
|
||||
}
|
||||
|
||||
/**
|
||||
* The plugins used by the application
|
||||
* The plugins used by the application, списък на плъгините, използвани в приложението
|
||||
* @type {AppPlugin[]}
|
||||
*/
|
||||
plugins = [];
|
||||
|
||||
/**
|
||||
* Declaration of plugin usage
|
||||
* Declaration of plugin usage, деклариране на употреба на плъгин
|
||||
* @param {AppPlugin} plugin The plugin to be used
|
||||
*/
|
||||
async use(plugin){
|
||||
@@ -27,7 +27,7 @@ class App{
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the application. All plugins are initialized at this stage
|
||||
* Initializes the application. All plugins are initialized at this stage, инициализация на приложението, на тази стъпка се инициализират всички регистрирани плъгини
|
||||
*/
|
||||
async init(){
|
||||
for (let p of this.plugins){
|
||||
@@ -37,8 +37,8 @@ class App{
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports modules as plugins in the app by a given list
|
||||
* @param {Array} modules Modules to be imported
|
||||
* Imports modules as plugins in the app by a given list, импортиране на списък от модули, които да бъдат регистрирани като плъгини в приложението
|
||||
* @param {Array} modules Modules to be imported, масив от модули
|
||||
*/
|
||||
async importModules(modules){
|
||||
const mods = {};
|
||||
@@ -52,8 +52,8 @@ class App{
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces a plugin
|
||||
* @param {AppPlugin} p Plugin to be replaced
|
||||
* Replaces a plugin, подмяна на плъгин
|
||||
* @param {AppPlugin} p Plugin to be replaced, плъгин, който да бъде подменен
|
||||
*/
|
||||
async replace(p){
|
||||
let old = this[p.name];
|
||||
@@ -64,7 +64,7 @@ class App{
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the application. All Plugins are started at this point
|
||||
* Starts the application. All Plugins are started at this point. Стартиране на приложението и всички негови плъгини
|
||||
*/
|
||||
async start(){
|
||||
for (let p of this.plugins){
|
||||
@@ -78,89 +78,89 @@ class App{
|
||||
/* The following are pseudo in order to keep documentation aligned to the code */
|
||||
|
||||
/**
|
||||
* The core application plugins
|
||||
* The core application plugins, основни плъгини на приложението
|
||||
*/
|
||||
class AppCore{
|
||||
/**
|
||||
* The configuration plugin instance
|
||||
* The configuration plugin instance, конфигурационен плъгин
|
||||
* @type Config
|
||||
*/
|
||||
config = undefined;
|
||||
|
||||
/**
|
||||
* The database plugin instance
|
||||
* The database plugin instance, плъгин към базата от данни
|
||||
* @type Db
|
||||
*/
|
||||
db = undefined;
|
||||
|
||||
/**
|
||||
* The web server plugin instance
|
||||
* The web server plugin instance, уеб сървър плъгин
|
||||
* @type WebServer
|
||||
*/
|
||||
webServer = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main logical part application plugins
|
||||
* The main logical part application plugins, плъгини, свързани с логическия слой на приложението - контролни класове
|
||||
*/
|
||||
class AppManagement {
|
||||
|
||||
/**
|
||||
* Game objects manager plugin instance
|
||||
* Game objects manager plugin instance, управление на игрови обекти
|
||||
* @type GameObjectsManager
|
||||
*/
|
||||
gameObject = undefined;
|
||||
|
||||
/**
|
||||
* Games manager plugin instance
|
||||
* Games manager plugin instance, управление на игрови дефиниции
|
||||
* @type GamesManager
|
||||
*/
|
||||
games = undefined;
|
||||
|
||||
/**
|
||||
* Rules manager plugin instance
|
||||
* Rules manager plugin instance, управление на игрови правила
|
||||
* @type RulesManager
|
||||
*/
|
||||
rules = undefined;
|
||||
|
||||
/**
|
||||
* Scenarios manager plugin instance
|
||||
* Scenarios manager plugin instance, управление на игрови сценарии
|
||||
* @type ScenariosManager
|
||||
*/
|
||||
scenarios = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main application controller plugin instances
|
||||
* The main application controller plugin instances, основни комуникационни (гранични) класове
|
||||
*/
|
||||
class AppControllerApi {
|
||||
|
||||
/**
|
||||
* Game objects controller plugin instance
|
||||
* Game objects controller plugin instance, контролер на игрови обекти
|
||||
* @type GameObjectsController
|
||||
*/
|
||||
gameObjectsApi = undefined;
|
||||
|
||||
/**
|
||||
* Games controller plugin instance
|
||||
* Games controller plugin instance, контролер на игрови дефиниции
|
||||
* @type GamesController
|
||||
*/
|
||||
gamesApi = undefined;
|
||||
|
||||
/**
|
||||
* Rules controller plugin instance
|
||||
* Rules controller plugin instance, контролер на игрови правила
|
||||
* @type RulesController
|
||||
*/
|
||||
rulesApi = undefined;
|
||||
|
||||
/**
|
||||
* Scenarios controller plugin instance
|
||||
* Scenarios controller plugin instance, контролер на игрови сценарии
|
||||
* @type ScenariosController
|
||||
*/
|
||||
scenariosApi = undefined;
|
||||
|
||||
/**
|
||||
* Asset controller plugin instance
|
||||
* Asset controller plugin instance, контролер на игрови активи
|
||||
* @type AssetController
|
||||
*/
|
||||
assetApi = undefined;
|
||||
@@ -168,21 +168,21 @@ class AppControllerApi {
|
||||
|
||||
class AppConcrete {
|
||||
/**
|
||||
* Application core plugins
|
||||
* Application core plugins, плъгини - ядро на приложението
|
||||
* @type AppCore
|
||||
* @memberof App
|
||||
*/
|
||||
core = undefined;
|
||||
|
||||
/**
|
||||
* Application management plugins
|
||||
* Application management plugins, управление на приложението - логически класове
|
||||
* @type AppManagement
|
||||
* @memberof App
|
||||
*/
|
||||
management = undefined;
|
||||
|
||||
/**
|
||||
* Application controller API plugins
|
||||
* Application controller API plugins, управление на граничните класове - контролери
|
||||
* @type AppControllerApi
|
||||
* @memberof App
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user