Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            while (true)
            {
                StartWindow window = new StartWindow();
                Application.Run(window);

                if (window.StartGame)
                {
                    MainWindow main = new MainWindow(window.Game);
                    Application.Run(main);

                    if (main.ShouldQuit)
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
        }
Example #2
0
 public ExploreControl(Location currentLocation, MainWindow mainWindow)
 {
     InitializeComponent();
     this.mainWindow = mainWindow;
     encounterButtons = new List<Button>();
     UpdateLocation(currentLocation);
     UINotifier.Get().OnLocationUpdated += UpdateLocation;
 }
Example #3
0
 public TreasureView(Treasure treasure, MainWindow window)
 {
     this.window = window;
     this.treasure = treasure;
     InitializeComponent();
     playerInfo.FillInfo(treasure.Player);
     enemyInfo.FillInfo(treasure.Loot);
     lootView.SetItems(treasure.LootItems);
 }
Example #4
0
        public MerchantView(Merchant merchant, MainWindow window)
        {
            InitializeComponent();
            this.merchant = merchant;
            this.window = window;

            merchantItems.SetItems(merchant.MerchantItems);
            playerItems.SetItems(merchant.Player.Inventory);

            playerNameLabel.Text = merchant.Player.Name;
            merchantLabel.Text = merchant.GetName();
            goldLabel.Text = "Gold: " + merchant.Player.Gold.ToString();

            playerItems.CanAddItem += PlayerItems_CanAddItem;
            playerItems.AddItem += PlayerItems_AddItem;
            playerItems.RemoveItem += PlayerItems_RemoveItem;
            merchantItems.RemoveItem += MerchantItems_RemoveItem;
            merchantItems.AddItem += MerchantItems_AddItem;
            UINotifier.Get().OnPlayerInventoryUpdated += MerchantView_OnPlayerInventoryUpdated;
        }
 public EncounterViewFactory(MainWindow window)
 {
     this.window = window;
 }