Gestion auto de l'état sonné en combat

This commit is contained in:
2021-02-17 11:16:27 +01:00
parent 98c6133938
commit 1cdadbd9d6
5 changed files with 57 additions and 10 deletions

View File

@ -85,10 +85,12 @@ export class RdDCommands {
this.commandsTable = {};
}
/* -------------------------------------------- */
registerCommand(command) {
this._addCommand(this.commandsTable, command.path, '', command);
}
/* -------------------------------------------- */
_addCommand(targetTable, path, fullPath, command) {
if (!this._validateCommand(targetTable, path, command)) {
return;
@ -107,6 +109,7 @@ export class RdDCommands {
}
}
/* -------------------------------------------- */
_validateCommand(targetTable, path, command) {
if (path.length > 0 && path[0] && command.descr && (path.length != 1 || targetTable[path[0]] == undefined)) {
return true;