public void SetInput(AdventurerAgent agent, AdventureShopInput choice) { if (!_currentLocation.ContainsKey(agent)) { _currentLocation.Add(agent, 0); } var shopAgent = shopChooserSubSystem.GetCurrentShop(agent); var shopItems = shopCraftingSystem.system.shopSubSubSystem.GetShopItems(shopAgent); switch (choice) { case AdventureShopInput.Up: MovePosition(agent, shopItems, 1); break; case AdventureShopInput.Down: MovePosition(agent, shopItems, -1); break; case AdventureShopInput.Select: if (_currentLocation[agent] < shopItems.Count) { var shopDetails = shopItems[_currentLocation[agent]].itemDetails; shopCraftingSystem.system.shopSubSubSystem.PurchaseItem(shopAgent, shopDetails, agent.wallet, agent.inventory); } break; } }
public void SetInput(AdventurerAgent agent, AdventureShopInput choice) { GetCurrentShop(agent); switch (choice) { case AdventureShopInput.Up: MovePosition(agent, 1); break; case AdventureShopInput.Down: MovePosition(agent, -1); break; case AdventureShopInput.Select: break; } }