public iComponentModel[] GetData() { scrollList = new ScrollListModel[1]; scrollModels = new List <ItemContainerModel>(); for (int i = 0; i < testItems.Length; i++) { ItemContainerModel gridItem = new ItemContainerModel(); gridItem.item = testItems[i].itemData; scrollModels.Add(gridItem); } scrollList[0] = new ScrollListModel(91);//with a max amount of 91 scrollList[0].gridItems = scrollModels; return(scrollList); }
public ScreenInventoryTransferModel(ObjectInventoryManager worldObject, List <Item> local, List <Item> remote) { remoteInventoryType = worldObject.inventory.inventoryType; localInventoryScroll = new ScrollListModel(worldObject.containLimit); if (remoteInventoryType == ObjectInventoryTypes.Type.Scroll) { remoteInventory = new ScrollListModel(worldObject.containLimit); } else { remoteInventory = new ScreenMachineProcessorModel(worldObject); } localInventoryScroll.AddContainers(local); remoteInventory.AddContainers(remote); }
public void BuyItems(ScrollListModel shop, ScrollListModel player) { if (totalSelectedPrice <= playerInventory.model.money) { var toTransfer = shop.gridItems.Where(p => p.selected == true).Select(p => p.Clone()).ToList(); //Add the to transfer items to the player viewmodel player.gridItems = player.gridItems.Concat(toTransfer).ToList(); view.shopScrollList.ApplyModel(view.shopScrollList.model); view.localScrollList.ApplyModel(view.localScrollList.model); playerInventory.model.money -= totalSelectedPrice; UpdateModel(); view.UpdateModel(); } }
public ScreenMarketModel(int maxPlayerContainAmount, int maxShopContainAmount) { localInventoryScroll = new ScrollListModel(maxPlayerContainAmount); shopInventoryScroll = new ScrollListModel(maxShopContainAmount); }
public ScreenPlayerInventoryModel(int maxContainAmount) { localInventoryScroll = new ScrollListModel(maxContainAmount); }