コード例 #1
0
 public bool CreateContainerInstance(out DataInventoryContainer container)
 {
     if (AmINull())
     {
         container = null;
         return(false);
     }
     if (Type == ContainerType.Storage)
     {
         container = new DataInventoryContainer(this);
         return(true);
     }
     if (Type == ContainerType.Equiptment)
     {
         container = new DataEquiptmentContainer(this);
         return(true);
     }
     if (Type == ContainerType.WeaponWheel)
     {
         container = new DataWeaponWheelContainer(this);
         return(true);
     }
     container = null;
     return(false);
 }
コード例 #2
0
ファイル: ContainerInfo.cs プロジェクト: MrX101/MVCInventory
 public ContainerInfo(DataInventoryContainer container)
 {
     InventorySlots    = new SlotInfo[] { };
     Id                = container.ContainerId;
     _allowedItemTypes = container.AllowedItemTypes;
     ContainerType     = Inventory.GetContainerTypeEnum(container);
     if (container.GetItemSlotsInfo(out SlotInfo[] inventorySlots))
     {
         InventorySlots = inventorySlots;
     }
 }