main #48
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,3 @@
 | 
			
		||||
.panel-actions {
 | 
			
		||||
  float: right;
 | 
			
		||||
}
 | 
			
		||||
@ -32,6 +32,7 @@ export class ItemEditorComponent {
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  deleteInheritedItemgroup(itemgroup: ItemGroup) {
 | 
			
		||||
    this.item!.inheritedGroups = this.item!.inheritedGroups.filter(group => group.componentName !== itemgroup.componentName);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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) {
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,4 @@
 | 
			
		||||
import {ModelComponent} from "../ModelComponent";
 | 
			
		||||
import {ItemQuality} from "./ItemQuality";
 | 
			
		||||
import {ItemGroupCharacteristic} from "./ItemgroupCharacteristic";
 | 
			
		||||
 | 
			
		||||
export abstract class ItemGroup extends ModelComponent {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +0,0 @@
 | 
			
		||||
export class ItemQuality {
 | 
			
		||||
 | 
			
		||||
  key: string
 | 
			
		||||
  value: number
 | 
			
		||||
 | 
			
		||||
  constructor(key: string, value: number) {
 | 
			
		||||
    this.key = key;
 | 
			
		||||
    this.value = value;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user