Exemplo n.º 1
0
        public void SellPotion(Potion potion, Shopkeeper shopkeeper)
        {
            this.Gold += potion.Value;

            this.PotionsForSale.Remove(potion);

            this.OnPotionSold(potion, shopkeeper);
        }
Exemplo n.º 2
0
        public void Start()
        {
            this.Shop.Start();

            DayChanged += (sender, e) => {
                Employee applicant = null;

                var name   = this.NameDatabase[this.Random.Next(this.NameDatabase.Length)];
                var salary = this.Random.Next(1, 100);

                switch (this.Random.Next(4))
                {
                case 0: applicant = new Herbalist(name, salary); break;

                case 1: applicant = new Guard(name, salary); break;

                case 2: applicant = new Apothecary(name, salary); break;

                case 3: applicant = new Shopkeeper(name, salary); break;
                }

                if (applicant != null)
                {
                    this.ReceiveApplication(applicant);
                }
            };

            DayChanged += (sender, e) => {
                var flask = (Flask)this.FlaskDatabase[this.Random.Next(this.FlaskDatabase.Length)].Clone();

                this.DisplayFlask(flask);
            };

            DayChanged += (sender, e) => {
                this.Shop.Gold += 1000;
            };
        }
Exemplo n.º 3
0
 private void OnPotionSold(Potion potion, Shopkeeper shopkeeper) => PotionSold?.Invoke(this, new PotionSoldEventArgs(potion, shopkeeper));