Пример #1
0
        public override void Exit(Miner miner)
        {
            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Leavin' the bank");
        }
Пример #2
0
        public override void Execute(Miner miner)
        {
            //deposit the gold
            miner.Wealth     += miner.GoldCarried;
            miner.GoldCarried = 0;

            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Depositing gold. Total savings now: ");
            Console.WriteLine(miner.Wealth);

            //wealthy enough to have a well earned rest?
            if (miner.Wealth >= Common.ComfortLevel)
            {
                Console.ForegroundColor = Color;

                Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

                Console.WriteLine("WooHoo! Rich enough for now. Back home to mah li'lle lady");

                miner.ChangeState(GoHomeAndSleepTilRested.Instance);

                //otherwise get more gold
            }
            else
            {
                miner.ChangeState(EnterMineAndDigForNugget.Instance);
            }
        }
Пример #3
0
        public override void Exit(Miner miner)
        {
            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Ah'm leavin' the goldmine with mah pockets full o' sweet gold");
        }
Пример #4
0
        public override void Execute(Miner miner)
        {
            //the miner digs for gold until he is carrying in excess of MaxNuggets.
            //If he gets thirsty during his digging he packs up work for a while and
            //changes state to go to the saloon for a whiskey.
            miner.GoldCarried += 1;

            miner.IncreaseFatigue();

            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Pickin' up a nugget");

            //if enough gold mined, go and put it in the bank
            if (miner.PocketsFull)
            {
                miner.ChangeState(VisitBankAndDepositGold.Instance);
            }

            if (miner.Thirsty())
            {
                miner.ChangeState(QuenchThirst.Instance);
            }
        }
Пример #5
0
        public override void Exit(Miner miner)
        {
            Console.ForegroundColor = Color;

            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Leaving the saloon, feelin' good");
        }
Пример #6
0
        public override void Enter(Miner miner)
        {
            if (miner.Location != LocationType.Saloon)
            {
                miner.Location = LocationType.Saloon;

                Console.ForegroundColor = Color;
                Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

                Console.WriteLine("Boy, ah sure is thusty! Walking to the saloon");
            }
        }
Пример #7
0
        public override void Enter(Miner miner)
        {
            if (miner.Location == LocationType.Shack)
            {
                return;
            }
            Console.ForegroundColor = Color;

            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Walkin' home");

            miner.Location = LocationType.Shack;
        }
Пример #8
0
        public override void Enter(Miner miner)
        {
            //on entry the miner makes sure he is located at the bank

            if (miner.Location == LocationType.Bank)
            {
                return;
            }

            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Goin' to the bank. Yes siree");
            miner.Location = LocationType.Bank;
        }
Пример #9
0
        public override void Enter(Miner miner)
        {
            //if the miner is not already located at the goldmine, he must
            //change location to the gold mine
            if (miner.Location == LocationType.Goldmine)
            {
                return;
            }
            Console.ForegroundColor = Color;
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Walkin' to the goldmine");

            miner.Location = LocationType.Goldmine;
        }
Пример #10
0
        public override void Execute(Miner miner)
        {
            if (miner.Thirsty())
            {
                miner.BuyAndDrinkAWhiskey();

                Console.ForegroundColor = Color;
                Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

                Console.WriteLine("That's mighty fine sippin liquer");

                miner.ChangeState(EnterMineAndDigForNugget.Instance);
            }
            else
            {
                Console.ForegroundColor = Color;
                Console.WriteLine("ERROR!" + "ERROR!" + "ERROR!");
            }
        }
Пример #11
0
        public override void Execute(Miner miner)
        {
            //if miner is not fatigued start to dig for nuggets again.
            if (!miner.Fatigued())
            {
                Console.ForegroundColor = Color;
                Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

                Console.WriteLine("What a God darn fantastic nap! Time to find more gold");

                miner.ChangeState(EnterMineAndDigForNugget.Instance);
            }
            else
            {
                //sleep
                miner.DecreaseFatigue();

                Console.ForegroundColor = Color;
                Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

                Console.WriteLine("ZZZZ... ");
            }
        }
Пример #12
0
        public override void Exit(Miner miner)
        {
            Console.WriteLine(EntityNames.GetNameOfEntity(miner.UniqueId));

            Console.WriteLine("Leaving the house");
        }