예제 #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");
        }