public MainMenu(Game game, DGetItem<Item> itemGenerator, MonsterRepository monsterRepository) { InitializeComponent(); this.game = game; this.itemGenerator = itemGenerator; this.monsterRepository = monsterRepository; }
public GameMenu(Game game, DGetItem<Item> itemGenerator, Player player, MonsterRepository monsterRepository) { InitializeComponent(); this.game = game; this.itemGenerator = itemGenerator; this.player = player; this.monsterRepository = monsterRepository; this.UpdateText(); }
public static DGetItem<Item> GetItem(DGetItemStat getStat, IDictionary<string, DGetItem<Item>> getItemDictionary, DGetItem<Item> getDefaultItem) { return itemid => { var type = getStat(itemid, "type"); DGetItem<Item> getItem; if (getItemDictionary.TryGetValue(type, out getItem)) { return getItem(itemid); } else { return getDefaultItem(itemid); } }; }
public ShopMenu(Player player, DGetItem<Item> itemGenerator) { InitializeComponent(); shop = new Shop(player, itemGenerator); this.ShopInventoryPanel.RowCount = shop.Stock.Count; for (int i = 0; i < shop.Stock.Count; i++) { shopInventoryPriceLabel.Add(new Label()); setupNewInventoryPriceLabel(i, this.shopInventoryPriceLabel, this.ShopInventoryPanel, shop.Stock); shopInventoryPicture.Add(new PictureBox()); setupNewInventoryPicture(i, this.shopInventoryPicture, this.ShopInventoryPanel, shop.Stock, Action.Buy); shopInventoryLabel.Add(new Label()); setupNewInventoryLabel(i, this.shopInventoryLabel, this.ShopInventoryPanel, shop.Stock); } this.showPlayerInventory(); }
public Game(DGetItem<Item> itemGenerator) { this.getItem = itemGenerator; }