Example #1
0
 public BattleAI(GameClient client)
 {
     _client = client;
 }
Example #2
0
        public void SetClient(GameClient client)
        {
            Game = client;
            AI = null;
            Stop();

            if (client != null)
            {
                AI = new BattleAI(client);
                client.ConnectionOpened += Client_ConnectionOpened;
                client.ConnectionFailed += Client_ConnectionFailed;
                client.ConnectionClosed += Client_ConnectionClosed;
                client.BattleMessage += Client_BattleMessage;
                client.SystemMessage += Client_SystemMessage;
                client.DialogOpened += Client_DialogOpened;
            }
            ClientChanged?.Invoke();
        }
Example #3
0
 private void LoginUpdate()
 {
     GameClient client;
     GameConnection.Server server = Account.Server == "BLUE" ? GameConnection.Server.Blue : GameConnection.Server.Red;
     if (Account.Socks.Version != SocksVersion.None)
     {
         // TODO: Clean this code.
         client = new GameClient(new GameConnection(server, (int)Account.Socks.Version, Account.Socks.Host, Account.Socks.Port, Account.Socks.Username, Account.Socks.Password),
             new MapConnection((int)Account.Socks.Version, Account.Socks.Host, Account.Socks.Port, Account.Socks.Username, Account.Socks.Password));
     }
     else
     {
         client = new GameClient(new GameConnection(server), new MapConnection());
     }
     SetClient(client);
     client.Open();
 }
Example #4
0
 public Pathfinding(GameClient client)
 {
     _client = client;
     _hasSurfAbility = client.HasSurfAbility();
 }