コード例 #1
0
 public FurnitureSlot(FurnitureSlot slot)
 {
     Name                  = slot.Name;
     ID                    = slot.ID;
     Description           = slot.Description;
     AvailableFurnitureIDs = slot.AvailableFurnitureIDs;
     SpaceRequired         = slot.SpaceRequired;
 }
コード例 #2
0
    public List <Furniture> GetAvailableFurnitureForSlot(FurnitureSlot slot)
    {
        List <Furniture> availableFurniture = new List <Furniture>();

        foreach (int id in slot.AvailableFurnitureIDs)
        {
            availableFurniture.Add(furniture[id]);
        }
        return(availableFurniture);
    }
コード例 #3
0
    public void DepositOther(FurnitureSlot slot)
    {
        if (currentOtherItem != null && slot.Inventory.GetAmountOfItem(currentOtherItem) < slot.FurnitureToBuild.GetCostOfItem(currentOtherItem.Id))
        {
            int amount = Math.Min(gameState.GetPlayerBank().GetInventory().GetAmountOfItem(currentOtherItem), (slot.FurnitureToBuild.GetCostOfItem(currentOtherItem.Id) - slot.Inventory.GetAmountOfItem(currentOtherItem)));
            gameState.GetPlayerBank().GetInventory().RemoveAsManyItemsAsPossible(currentOtherItem, amount);
            slot.Inventory.AddMultipleOfItem(currentOtherItem, amount);
            messageManager.AddMessage("Added " + amount + " " + currentOtherItem.ItemName + " to " + slot.Name);
        }

        gameState.UpdateState();
    }
コード例 #4
0
 public void Withdraw(FurnitureSlot slot)
 {
     if (gameState.GetPlayerInventory().AddMultipleOfItem(itemDatabase.GetItemByID(slot.FurnitureToBuild.WithdrawItemID), slot.FurnitureToBuild.WithdrawItemAmount))
     {
         slot.FurnitureToBuild.LastWithdrawn = DateTime.UtcNow;
         messageManager.AddMessage("You take " + slot.FurnitureToBuild.WithdrawItemAmount + " " + itemDatabase.GetItemByID(slot.FurnitureToBuild.WithdrawItemID).ItemName + "s.");
     }
     else
     {
         messageManager.AddMessage("You don't have enough inventory space.");
     }
     gameState.UpdateState();
 }
コード例 #5
0
 public void DepositBars(FurnitureSlot slot)
 {
     if (currentBar != null && slot.Inventory.GetAmountOfBars() < slot.FurnitureToBuild.BarsRequired)
     {
         int amount = Math.Min(gameState.GetPlayerBank().GetInventory().GetAmountOfItem(currentBar), (slot.FurnitureToBuild.BarsRequired - slot.Inventory.GetAmountOfBars()));
         gameState.GetPlayerBank().GetInventory().RemoveAsManyItemsAsPossible(currentBar, amount);
         slot.Inventory.AddMultipleOfItem(currentBar, amount);
         messageManager.AddMessage("Added " + amount + " " + currentBar.ItemName + "s to " + slot.Name);
         if (gameState.GetPlayerBank().GetInventory().GetAmountOfItem(currentBar) == 0)
         {
             SetCurrentBar(gameState.GetPlayerBank().GetInventory().GetLowestLevelBar());
         }
     }
     gameState.UpdateState();
 }
コード例 #6
0
    public void CancelBuild(FurnitureSlot slot)
    {
        foreach (KeyValuePair <GameItem, int> pair in slot.Inventory.GetItems())
        {
            gameState.GetPlayerBank().GetInventory().AddMultipleOfItem(pair.Key, pair.Value);
        }
        if (emptySlots.Remove(slot))
        {
            messageManager.AddMessage("You have cancelled building the " + slot.Name + " and any materials you used have been returned to the bank.");
        }
        else
        {
            messageManager.AddMessage("Failed to remove slot because it wasnt event there.");
        }

        gameState.UpdateState();
    }
コード例 #7
0
 public void CompleteFurniture(FurnitureSlot slot)
 {
     slot.isFinished = true;
     slot.FurnitureToBuild.IsFinished = true;
     gameState.UpdateState();
 }
コード例 #8
0
 public void BeginBuilding(Furniture furniture, FurnitureSlot slot)
 {
     slot.SetFurniture(furniture);
     slot.hasSelected = true;
     gameState.UpdateState();
 }
コード例 #9
0
 public int GetSlotMinimumLevel(FurnitureSlot slot)
 {
     return(0);
 }