Ejemplo n.º 1
0
 public static void Battleship(MessageEventArgs e)
 {
     if (BattleShip.battleship != null && BattleShip.battleship.playing)
     {
         if (BattleShip.battleship.awaiting)
         {
             if (e.User.Name.StartsWith("CandyBot"))
             {
                 BattleShip.battleship.previous = e;
                 BattleShip.battleship.awaiting = false;
             }
         }
         else if (BattleShip.battleship.awaitingx1)
         {
             BattleShip.battleship.previousx1 = e;
             BattleShip.battleship.awaitingx1 = false;
         }
         else if (BattleShip.battleship.awaitingx2)
         {
             BattleShip.battleship.previousx2 = e;
             BattleShip.battleship.awaitingx2 = false;
         }
         if (e.Message.Text.StartsWith("/teams"))
         {
             BattleShip.MakeTeams(e);
         }
         if (e.Message.Text.StartsWith("/test "))
         {
             BattleShip.Main(e, 0);
         }
         else if (e.Message.Text.StartsWith("/ready"))
         {
             BattleShip.GetReady(e);
         }
         else if (e.Message.Text.StartsWith("/attack "))
         {
             BattleShip.Main(e, 1);
         }
         else if (e.Message.Text.StartsWith("/join"))
         {
             BattleShip.AddPlayer(e);
         }
         else if (e.Message.Text.StartsWith("/start"))
         {
             BattleShip.StartGame(e);
         }
         else if (e.Message.Text.StartsWith("/leave"))
         {
             BattleShip.LeaveList(e);
         }
     }
     else if (e.Message.Text.StartsWith("/test"))
     {
         BattleShip.First(e, bot);
     }
 }
Ejemplo n.º 2
0
 public static void First(MessageEventArgs e, Discord.DiscordClient b)
 {
     bot                = b;
     battleship         = new BattleShip();
     battleship.playing = true;
     battleship.users   = new List <User>();
     battleship.teams1  = new List <User>();
     battleship.teams2  = new List <User>();
     e.Channel.SendMessage("Type /join if you want to play");
 }