Beispiel #1
0
 public void CmdWait(int bid)
 {
     if (!Bots.ContainsKey(bid))
     {
         throw new CommandException("wait", "bot does not exist");
     }
 }
Beispiel #2
0
        public void CmdFlip(int bid)
        {
            if (!Bots.ContainsKey(bid))
            {
                throw new CommandException("flip", "bot does not exist");
            }

            Harmonics = !Harmonics;
        }
Beispiel #3
0
    public Bot GetBot(int id)
    {
        if (Bots.ContainsKey(id))
        {
            return(Bots[id]);
        }
        var r = new Bot(id);

        Bots.Add(id, r);
        return(r);
    }
        public async Task UpdateBot(InventoryBot bot)
        {
            await _dao.UpdatePlayerBotAsync(bot);

            if (bot.RoomId != 0)
            {
                Bots.Remove(bot.Id);
            }
            else
            {
                if (!Bots.ContainsKey(bot.Id))
                {
                    Bots.Add(bot.Id, bot);
                }
            }
        }