diff --git a/angular.json b/angular.json index d7425fa..9380e3b 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,8 @@ "cli": { "schematicCollections": [ "@angular-eslint/schematics" - ] + ], + "analytics": false }, "version": 1, "newProjectRoot": "projects", diff --git a/src/app/project/game-model/GameModel.ts b/src/app/project/game-model/GameModel.ts index 66dd46c..c17141e 100644 --- a/src/app/project/game-model/GameModel.ts +++ b/src/app/project/game-model/GameModel.ts @@ -5,6 +5,7 @@ import {State} from "./gamesystems/states/State"; import {ProductGamesystem} from "./gamesystems/ProductGamesystem"; import {SimpleGamesystem} from "./gamesystems/SimpleGamesystem"; import {StorageModel} from "./fs/StorageModel"; +import { Character } from "./characters/Character"; export class GameModel { gameModelName: string @@ -12,6 +13,8 @@ export class GameModel { gamesystems: Gamesystem[] = []; scriptAccounts: ScriptAccount[] = []; + characters: Character[] = [] + constructor(gameModelName: string) { this.gameModelName = gameModelName; } @@ -97,4 +100,16 @@ export class GameModel { } }) } + + addCharacter(character: Character) { + const duplicateCharacter = this.characters.filter(c => c.componentName === character.componentName).length > 0; + if(!duplicateCharacter) { + this.characters.push(character); + } + } + + removeCharacter(character: Character) { + this.characters = this.characters.filter(c => c.componentName !== character.componentName); + } + } diff --git a/src/app/project/game-model/ModelComponentType.ts b/src/app/project/game-model/ModelComponentType.ts index 77a75a7..14eaf8b 100644 --- a/src/app/project/game-model/ModelComponentType.ts +++ b/src/app/project/game-model/ModelComponentType.ts @@ -1,5 +1,6 @@ export enum ModelComponentType { SCRIPTACCOUNT, - GAMESYTEM + GAMESYTEM, + CHARACTER } diff --git a/src/app/project/game-model/characters/Character.ts b/src/app/project/game-model/characters/Character.ts new file mode 100644 index 0000000..4945e09 --- /dev/null +++ b/src/app/project/game-model/characters/Character.ts @@ -0,0 +1,10 @@ +import { ModelComponent } from "../ModelComponent"; +import { ModelComponentType } from "../ModelComponentType"; + +export class Character extends ModelComponent { + + constructor(characterName: string, characterDescription: string) { + super(characterName, characterDescription, ModelComponentType.CHARACTER) + } + +} \ No newline at end of file