Example #1
0
        public override bool OnMesssage(Miner miner, Telegram telegram)
        {
            switch (telegram.messageType)
            {
            case MessageType.HiHoneyImHome:
                return(false);

            case MessageType.StewsReady:
                Printer.PrintMessageData("Message handled by " + miner.Id + " at time ");
                Printer.Print(miner.Id, "Okay Hun, ahm a comin'!");
                miner.StateMachine.ChangeState(new EatStew());
                return(true);

            default:
                return(false);
            }
        }
Example #2
0
        public override bool OnMesssage(Outlaw outlaw, Telegram telegram)
        {
            switch (telegram.messageType)
            {
            case MessageType.SheriffEncountered:
                Printer.Print(outlaw.Id, "Prepare to die instead, sheriff!");
                Message.DispatchMessage(0, outlaw.Id, telegram.Sender, MessageType.Gunfight);
                return(true);

            case MessageType.Dead:
                outlaw.StateMachine.ChangeState(new DropDeadOutlaw());
                return(true);

            case MessageType.Respawn:
                outlaw.StateMachine.ChangeState(new LurkInOutlawCamp());
                return(true);
            }
            return(false);
        }
Example #3
0
        public override void Execute(MinersWife minersWife)
        {
            switch (rand.Next(3))
            {
            case 0:
                Printer.Print(minersWife.Id, "Moppin' the floor");
                break;

            case 1:
                Printer.Print(minersWife.Id, "Washin' the dishes");
                break;

            case 2:
                Printer.Print(minersWife.Id, "Makin' the bed");
                break;

            default:
                break;
            }
        }
Example #4
0
        public override bool OnMesssage(MinersWife minersWife, Telegram telegram)
        {
            switch (telegram.messageType)
            {
            case MessageType.HiHoneyImHome:
                // Ignored here; handled in WifesGlobalState below
                return(false);

            case MessageType.StewsReady:
                // Tell Miner that the stew is ready now by sending a message with no delay
                Printer.PrintMessageData("Message handled by " + minersWife.Id + " at time ");
                Printer.Print(minersWife.Id, "StewReady! Lets eat");
                Message.DispatchMessage(0, minersWife.Id, minersWife.HusbandId, MessageType.StewsReady);
                minersWife.Cooking = false;
                minersWife.StateMachine.ChangeState(new DoHouseWork());
                return(true);

            default:
                return(false);
            }
        }
Example #5
0
        public override bool OnMesssage(MinersWife minersWife, Telegram telegram)
        {
            switch (telegram.messageType)
            {
            case MessageType.HiHoneyImHome:
                Printer.PrintMessageData("Message handled by " + minersWife.Id + " at time ");
                Printer.Print(minersWife.Id, "Hi honey. Let me make you some of mah fine country stew");
                minersWife.StateMachine.ChangeState(new CookStew());
                return(true);

            case MessageType.StewsReady:
                return(false);

            case MessageType.SheriffEncountered:
                //Printer.PrintMessageData("Message handled by " + minersWife.Id + " at time ");
                Printer.Print(minersWife.Id, "Good day to you too, sir!");
                return(true);

            default:
                return(false);
            }
        }
Example #6
0
        public override void Execute(Undertaker undertaker)
        {
            for (int i = 0; i < Agent.AgentsCount; ++i)
            {
                if (AgentManager.GetAgent(i).IsDead)
                {
                    if (undertaker.CurrentPosition != AgentManager.GetAgent(i).CurrentPosition)
                    {
                        undertaker.StateMachine.ChangeState(new UndertakerTravelToTarget(AgentManager.GetAgent(i).CurrentPosition, new LookForDeadBodies()));
                        return;
                    }
                    undertaker.CorpseID = i;
                }
            }

            Printer.Print(undertaker.Id, "Found the corpse of " + AgentManager.GetAgent(undertaker.CorpseID).GetType().Name + ".");

            if (undertaker.CorpseID >= 0)
            {
                undertaker.StateMachine.ChangeState(new UndertakerTravelToTarget(Location.cemetery, new DragOffTheBody()));
            }
        }
Example #7
0
 public override void Exit(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Leaving the Bank, time to celebrate!");
 }
Example #8
0
 public override void Enter(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Arrived in bank.");
 }
Example #9
0
        public override void Enter(Outlaw outlaw)
        {
            Printer.Print(outlaw.Id, "Arrived in the cemetery!");

            outlaw.BoredomCountdown = rand.Next(1, 10);
        }
Example #10
0
 public override void Enter(Outlaw outlaw)
 {
     Printer.Print(outlaw.Id, "Arrived in bank, Let's EARN some money!");
 }
Example #11
0
 public override void Exit(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Leaving the saloon.");
 }
Example #12
0
 public override void Exit(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Leaving the office.");
 }
Example #13
0
 public override void Execute(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Hovering in the office.");
 }
Example #14
0
        public override void Enter(Undertaker undertaker)
        {
            path = pathFinder.FindPath(undertaker.CurrentPosition, targetPosition);

            Printer.Print(undertaker.Id, "Walkin' to " + LocationProperties.ToString(LocationProperties.GetLocation(targetPosition)) + ".");
        }
Example #15
0
 public override void Enter(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Arrived in the office!");
 }
Example #16
0
 public override void Exit(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Leaving the cemetery");
 }
Example #17
0
 public override void Enter(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Carrying the body to the tombs in the cemetery!");
 }
Example #18
0
 public override void Enter(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Arrived in the saloon!");
 }
Example #19
0
        public override void Execute(Sheriff sheriff)
        {
            Printer.Print(sheriff.Id, "All drinks on me today!");

            sheriff.StateMachine.ChangeState(new SheriffTravelToTarget(sheriff.ChooseNextLocation(), new PatrolRandomLocation()));
        }
Example #20
0
 public override void Enter(Undertaker undertaker)
 {
     Printer.Print(undertaker.Id, "Arrived in " + LocationProperties.ToString(undertaker.Location) + ".");
 }
Example #21
0
 public override void Exit(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Puttin' the stew on the table");
 }
Example #22
0
 public override void Enter(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Walkin' to the can. Need to powda mah pretty li'lle nose");
 }
Example #23
0
 public override void Enter(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Time to do some more housework!");
 }
Example #24
0
 public override void Exit(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Leavin' the Jon");
 }
Example #25
0
 public override void Enter(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Goodbye, cruel world!");
     sheriff.IsDead = true;
 }
Example #26
0
 public override void Exit(Outlaw outlaw)
 {
     Printer.Print(outlaw.Id, "Leaving the cemetery.");
 }
Example #27
0
 public override void Execute(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Ahhhhhh! Sweet relief!");
     minersWife.StateMachine.RevertToPreviousState();  // this completes the state blip
 }
Example #28
0
        public override void Enter(Sheriff sheriff)
        {
            path = pathFinder.FindPath(sheriff.CurrentPosition, targetPosition);

            Printer.Print(sheriff.Id, "Walkin' to " + LocationProperties.ToString(LocationProperties.GetLocation(targetPosition)) + ".");
        }
Example #29
0
 public override void Execute(MinersWife minersWife)
 {
     Printer.Print(minersWife.Id, "Fussin' over food");
 }
Example #30
0
 public override void Exit(Sheriff sheriff)
 {
     Printer.Print(sheriff.Id, "Leaving " + LocationProperties.ToString(sheriff.Location) + ".");
 }