diff --git a/src/app/project/game-model/GameModel.ts b/src/app/project/game-model/GameModel.ts index a96ad25..a7d5c6c 100644 --- a/src/app/project/game-model/GameModel.ts +++ b/src/app/project/game-model/GameModel.ts @@ -29,7 +29,7 @@ export class GameModel { this.gameModelName = gameModelName; this.addAbstractItemgroup("Clothing", undefined); - this.addAbstractItemgroup("Inventory", undefined); + this.addConcreteItemgroup("Inventory", undefined); this.addConcreteItemgroup("Oberteil", GameModel.findItemgroupByName("Clothing", this.itemgroups)! as AbstractItemGroup); this.addConcreteItemgroup("Hose", GameModel.findItemgroupByName("Clothing", this.itemgroups)! as AbstractItemGroup); @@ -50,7 +50,7 @@ export class GameModel { } } - addConcreteItemgroup(groupName: string, parentgroup: AbstractItemGroup) { + addConcreteItemgroup(groupName: string, parentgroup: AbstractItemGroup | undefined) { //Ensure that Itemgroup does not exist if(parentgroup == undefined) { if(GameModel.findItemgroupByName(groupName, this.itemgroups) == undefined) { diff --git a/src/app/project/game-model/inventory/AbstractItemGroup.ts b/src/app/project/game-model/inventory/AbstractItemGroup.ts index 5141f5a..5702524 100644 --- a/src/app/project/game-model/inventory/AbstractItemGroup.ts +++ b/src/app/project/game-model/inventory/AbstractItemGroup.ts @@ -11,6 +11,7 @@ export class AbstractItemGroup extends ItemGroup { } protected addCharacteristicValue(characteristic: ItemGroupCharacteristic): void { + console.log("Abstract Characteristic Value: Do nothing (" , characteristic.characteristicName , ")") //Do Nothing } diff --git a/src/app/project/game-model/inventory/Item.ts b/src/app/project/game-model/inventory/Item.ts index bbe2140..cc2a8ac 100644 --- a/src/app/project/game-model/inventory/Item.ts +++ b/src/app/project/game-model/inventory/Item.ts @@ -30,6 +30,7 @@ export class Item extends ModelComponent { addInheritedGroup(itemgroup: ItemGroup) { if(this.findItemgroupByName(itemgroup.componentName) == undefined) { this.manuallyInheritedGroups.push(itemgroup); + itemgroup.manuallyInheritedItems.push(this); this.initializeItemCharacteristicsOfItemgroup(itemgroup); } } @@ -40,6 +41,7 @@ export class Item extends ModelComponent { } addCharacteristic(characteristic: ItemGroupCharacteristic) { + console.log("Add Characteristic: " , characteristic) const characteristicValue = new ItemgroupCharacteristicValue(characteristic, 0); if(!this.isValueInitialized(characteristic)) { this.itemCharacteristicValues.push(characteristicValue); diff --git a/src/app/project/game-model/inventory/ItemGroup.ts b/src/app/project/game-model/inventory/ItemGroup.ts index 3096e7b..e4dd726 100644 --- a/src/app/project/game-model/inventory/ItemGroup.ts +++ b/src/app/project/game-model/inventory/ItemGroup.ts @@ -12,6 +12,7 @@ export abstract class ItemGroup extends ModelComponent { addItemgroupCharacteristic(itemgroupCharacteristic: ItemGroupCharacteristic) { this.itemGroupCharacteristics.push(itemgroupCharacteristic); this.addCharacteristicValueForManuallyItems(itemgroupCharacteristic); + console.log("[Itemgroup] Add ItemgroupCharacteristic ", itemgroupCharacteristic); this.addCharacteristicValue(itemgroupCharacteristic); }