Exemple #1
0
 //Constructor for this class
 public InventoryItemStackData(int inventoryIndex_, IDTag objIDTag_, uint stackSize_)
 {
     this.itemStackIndex       = inventoryIndex_;
     this.objType              = objIDTag_.objType;
     this.iDNumber             = objIDTag_.numberID;
     this.numberOfItemsInStack = stackSize_ - 1; //Removing one because the first one is already saved in the index position
 }
    //Function called externally from SaveLoadManager.cs to get object references based on the values from the IDTag component if the component isn't available
    public GameObject GetPrefabFromID(IDTag.ObjectType objType_, int numberID_)
    {
        //Switch statement for the type of objet to get based on the ID enum
        switch (objType_)
        {
        case IDTag.ObjectType.Perk:
            return(this.perkList.GetPerkByIDNum(numberID_));

        case IDTag.ObjectType.ItemWeapon:
            return(this.weaponList.GetWeaponByIDNum(numberID_));

        case IDTag.ObjectType.ItemArmor:
            return(this.armorList.GetArmorByIDNum(numberID_));

        case IDTag.ObjectType.ItemQuest:
            return(this.questItemList.GetQuestItemByIDNum(numberID_));

        case IDTag.ObjectType.ItemConsumable:
            return(this.foodList.GetFoodByIDNum(numberID_));

        case IDTag.ObjectType.ItemMisc:
            return(this.itemList.GetItemByIDNum(numberID_));

        case IDTag.ObjectType.Location:
            return(this.locationList.GetLocationByIDNum(numberID_));

        case IDTag.ObjectType.Action:
            return(this.actionList.GetActionByIDNum(numberID_));

        default:
            //If for some reason the enum has no match, we return null and let the SaveLoadManager deal with it
            return(null);
        }
    }
Exemple #3
0
 //Constructor for this class
 public PrefabIDTagData(IDTag objIDTag_)
 {
     this.objType  = objIDTag_.objType;
     this.iDNumber = objIDTag_.numberID;
 }