Delete Inherited Itemgroups and Introduce ItemgroupCharacteristicValue
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				E2E Testing / test (push) Successful in 1m34s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	E2E Testing / test (push) Successful in 1m34s
				
			This commit is contained in:
		
							parent
							
								
									7ee8db2a37
								
							
						
					
					
						commit
						6eff107282
					
				@ -9,12 +9,12 @@
 | 
				
			|||||||
          <mat-panel-title>{{itemgroup.componentName}}</mat-panel-title>
 | 
					          <mat-panel-title>{{itemgroup.componentName}}</mat-panel-title>
 | 
				
			||||||
          <mat-panel-description>{{itemgroup.componentDescription}}</mat-panel-description>
 | 
					          <mat-panel-description>{{itemgroup.componentDescription}}</mat-panel-description>
 | 
				
			||||||
        </mat-expansion-panel-header>
 | 
					        </mat-expansion-panel-header>
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        <div class="panel-actions">
 | 
				
			||||||
 | 
					          <button mat-raised-button color="warn" (click)="deleteInheritedItemgroup(itemgroup)">Delete</button>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
      </mat-expansion-panel>
 | 
					      </mat-expansion-panel>
 | 
				
			||||||
    </mat-accordion>
 | 
					    </mat-accordion>
 | 
				
			||||||
    <div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
    <button mat-stroked-button style="width: 100%" (click)="onAddNewInheritedItemgroup()">Add Itemgroup</button>
 | 
					    <button mat-stroked-button style="width: 100%" (click)="onAddNewInheritedItemgroup()">Add Itemgroup</button>
 | 
				
			||||||
  </mat-card-content>
 | 
					  </mat-card-content>
 | 
				
			||||||
</mat-card>
 | 
					</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 {Component, Input, OnInit} from '@angular/core';
 | 
				
			||||||
import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
 | 
					import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
 | 
				
			||||||
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
 | 
					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 {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
 | 
				
			||||||
import {Item} from "../../../project/game-model/inventory/Item";
 | 
					import {Item} from "../../../project/game-model/inventory/Item";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,11 @@
 | 
				
			|||||||
import {ModelComponent} from "../ModelComponent";
 | 
					import {ModelComponent} from "../ModelComponent";
 | 
				
			||||||
import {ItemGroup} from "./ItemGroup";
 | 
					import {ItemGroup} from "./ItemGroup";
 | 
				
			||||||
 | 
					import {ItemgroupCharacteristicValue} from "./ItemgroupCharacteristicValue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Item extends ModelComponent {
 | 
					export class Item extends ModelComponent {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  inheritedGroups: ItemGroup[] = []
 | 
					  inheritedGroups: ItemGroup[] = []
 | 
				
			||||||
 | 
					  itemCharacteristics: ItemgroupCharacteristicValue[] = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  addInheritedGroup(itemgroup: ItemGroup) {
 | 
					  addInheritedGroup(itemgroup: ItemGroup) {
 | 
				
			||||||
    if(this.findItemgroupByName(itemgroup.componentName) == undefined) {
 | 
					    if(this.findItemgroupByName(itemgroup.componentName) == undefined) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,4 @@
 | 
				
			|||||||
import {ModelComponent} from "../ModelComponent";
 | 
					import {ModelComponent} from "../ModelComponent";
 | 
				
			||||||
import {ItemQuality} from "./ItemQuality";
 | 
					 | 
				
			||||||
import {ItemGroupCharacteristic} from "./ItemgroupCharacteristic";
 | 
					import {ItemGroupCharacteristic} from "./ItemgroupCharacteristic";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export abstract class ItemGroup extends ModelComponent {
 | 
					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