示例#1
0
        public string Answer(string key,Arena ar)
        {
            if (key == Vals.KEY_TO_RUN_BOT)
            {
                command = Vals.BOT_ACTION_COMMAND_SLEEP;

                try
                {
                    move(ar);
                }
                catch (Exception ex)
                {
                    command = Vals.BOT_ACTION_COMMAND_DIE;
                    return Vals.SYSTEM_BOT_ERROR_WHILE_EXECUTE;
                }
                return command;
            }
            return Vals.SECURITY_ERROR_BOT_RUN;
        }
示例#2
0
        static Arena createArena(string str,int ID)
        {
            Arena cArena = new Arena();
            cArena.arenaSize = new GamePoint(1024, 768);
            string[] space = str.Split(';');
            string[] bots = space[0].Split(' ');
            int t = 0;
            for (int i = 0; i < Bots.Count; i++)
            {
                string name = bots[t];
                int VSID = Convert.ToInt32( bots[t + 1]);
                GamePoint p = new GamePoint(Convert.ToInt32( bots[t + 2]),Convert.ToInt32( bots[t + 3]));
                GameDPoint s = new GameDPoint(Convert.ToDouble(bots[t + 4]),Convert.ToDouble(bots[t + 5]));
                int r = Convert.ToInt32( bots[t + 6]);

                if (VSID == Bots[i].VSID)
                {
                    cArena.Me = new ArenaPlayer(s, p, r);
                }
                else
                {
                    cArena.Players.Add(new ArenaPlayer(s, p, r));
                }
                t += 7;
            }

            return cArena;
        }
示例#3
0
 public virtual void move(Arena arena)
 {
 }
示例#4
0
 public override void move(Arena arena)
 {
     Console.WriteLine("Hello, I am First workig Bot");
 }