Example #1
0
        private void PerformBotDeath(MappedBot bt, BotEndReason bdr)
        {
            b.Assert.True(!bt.DeathNotificationOccured, "You shouldn't notify of a bots death twice.  Notification for " + bt.Bot.Name + " already sent");
            bt.DeathNotificationOccured = true;

            BotEndContext bdc = new BotEndContext();

            bdc.BotId  = bt.EngineId;
            bdc.Reason = bdr;

            hub.Launch <Message_Ui>(new Message_Ui(MainMessageKind.UIMessage, KnownSubkinds.BotEndOccured)
            {
                RequestContext = bdc
            });
            bt.Speed    = 0;
            bt.IsActive = false;
        }
Example #2
0
        private bool CheckForDepletedBot(MappedBot bt)
        {
            if (bt.PowerRemaining <= 0)
            {
                DeactivateBot(bt);
                BotEndContext bec = new BotEndContext();
                bec.BotId  = bt.EngineId;
                bec.Reason = BotEndReason.Depleted;

                hub.Launch <Message_Ui>(new Message_Ui(MainMessageKind.UIMessage, KnownSubkinds.BotEndOccured)
                {
                    //ObjectIdentity = bt.EngineId
                    RequestContext = bec
                });
                return(true);
            }
            return(false);
        }