public FurnitureSlot(FurnitureSlot slot) { Name = slot.Name; ID = slot.ID; Description = slot.Description; AvailableFurnitureIDs = slot.AvailableFurnitureIDs; SpaceRequired = slot.SpaceRequired; }
public List <Furniture> GetAvailableFurnitureForSlot(FurnitureSlot slot) { List <Furniture> availableFurniture = new List <Furniture>(); foreach (int id in slot.AvailableFurnitureIDs) { availableFurniture.Add(furniture[id]); } return(availableFurniture); }
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(); }
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(); }
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(); }
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(); }
public void CompleteFurniture(FurnitureSlot slot) { slot.isFinished = true; slot.FurnitureToBuild.IsFinished = true; gameState.UpdateState(); }
public void BeginBuilding(Furniture furniture, FurnitureSlot slot) { slot.SetFurniture(furniture); slot.hasSelected = true; gameState.UpdateState(); }
public int GetSlotMinimumLevel(FurnitureSlot slot) { return(0); }