inventory-items-2 #44

Closed
sebastian wants to merge 32 commits from inventory-items-2 into inventory
4 changed files with 6 additions and 2 deletions
Showing only changes of commit aa6c051246 - Show all commits

View File

@ -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) {

View File

@ -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
}

View File

@ -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);

View File

@ -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);
}