25 lines
		
	
	
		
			897 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			897 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import {InventorySlot} from "../game-model/inventory/intentory-slots/InventorySlot";
 | 
						|
 | 
						|
export class InventorySlotSerializer {
 | 
						|
 | 
						|
  private static  ignoredKeys: string[] = ['']
 | 
						|
 | 
						|
  public static serializeInventorySlots(inventorySlots: InventorySlot[]) {
 | 
						|
    return inventorySlots.map(inventorySlot => {
 | 
						|
      return {
 | 
						|
        slotName: inventorySlot.slotName,
 | 
						|
        slotCharacteristics: inventorySlot.slotCharacteristics.map(slotCharacteristic => {
 | 
						|
          return {
 | 
						|
            increasingCharacteristic: slotCharacteristic.increasingCharacteristic!.characteristicName,
 | 
						|
            decreasingCharacteristic: slotCharacteristic.decreasingCharacteristic!.characteristicName
 | 
						|
          }
 | 
						|
        }),
 | 
						|
        requiredInheritances: inventorySlot.requiredInheritances.map(itemgroup => {
 | 
						|
          return itemgroup.componentName
 | 
						|
        }),
 | 
						|
        combinable: inventorySlot.combinable
 | 
						|
      }
 | 
						|
    })
 | 
						|
  }
 | 
						|
}
 |