Delete Inherited Itemgroups and Introduce ItemgroupCharacteristicValue
All checks were successful
E2E Testing / test (push) Successful in 1m34s

This commit is contained in:
Sebastian Böckelmann 2024-05-07 14:58:27 +02:00
parent 7ee8db2a37
commit 6eff107282
8 changed files with 26 additions and 18 deletions

View File

@ -9,12 +9,12 @@
<mat-panel-title>{{itemgroup.componentName}}</mat-panel-title>
<mat-panel-description>{{itemgroup.componentDescription}}</mat-panel-description>
</mat-expansion-panel-header>
<div class="panel-actions">
<button mat-raised-button color="warn" (click)="deleteInheritedItemgroup(itemgroup)">Delete</button>
</div>
</mat-expansion-panel>
</mat-accordion>
<div>
</div>
<button mat-stroked-button style="width: 100%" (click)="onAddNewInheritedItemgroup()">Add Itemgroup</button>
</mat-card-content>
</mat-card>

View File

@ -0,0 +1,3 @@
.panel-actions {
float: right;
}

View File

@ -32,6 +32,7 @@ export class ItemEditorComponent {
})
}
deleteInheritedItemgroup(itemgroup: ItemGroup) {
this.item!.inheritedGroups = this.item!.inheritedGroups.filter(group => group.componentName !== itemgroup.componentName);
}
}

View File

@ -1,7 +1,6 @@
import {Component, Input, OnInit} from '@angular/core';
import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
import {ItemQuality} from "../../../project/game-model/inventory/ItemQuality";
import {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
import {Item} from "../../../project/game-model/inventory/Item";

View File

@ -1,9 +1,11 @@
import {ModelComponent} from "../ModelComponent";
import {ItemGroup} from "./ItemGroup";
import {ItemgroupCharacteristicValue} from "./ItemgroupCharacteristicValue";
export class Item extends ModelComponent {
inheritedGroups: ItemGroup[] = []
itemCharacteristics: ItemgroupCharacteristicValue[] = []
addInheritedGroup(itemgroup: ItemGroup) {
if(this.findItemgroupByName(itemgroup.componentName) == undefined) {

View File

@ -1,5 +1,4 @@
import {ModelComponent} from "../ModelComponent";
import {ItemQuality} from "./ItemQuality";
import {ItemGroupCharacteristic} from "./ItemgroupCharacteristic";
export abstract class ItemGroup extends ModelComponent {

View File

@ -1,10 +0,0 @@
export class ItemQuality {
key: string
value: number
constructor(key: string, value: number) {
this.key = key;
this.value = value;
}
}

View File

@ -0,0 +1,14 @@
import {ItemGroupCharacteristic} from "./ItemgroupCharacteristic";
export class ItemgroupCharacteristicValue {
key: ItemGroupCharacteristic
value: number
constructor(key: ItemGroupCharacteristic, value: number) {
this.key = key;
this.value = value;
}
}