Beispiel #1
0
        public GameAI(GameClient game, Duel duel)
        {
            Game = game;
            Duel = duel;
            Utils = new AIFunctions(duel);

            _dialogs = new Dialogs(game);
        }
        private static void Run(String username, String deck, String serverIP, int serverPort, String password)
        {
            Init("cards.cdb");

            // Start one client and connect it to the the requested server.
            GameClient clientA = new GameClient(username, deck, serverIP, serverPort, password);
            clientA.Start();

            while (clientA.Connection.IsConnected)
            {
                clientA.Tick();
                Thread.Sleep(1);
            }
        }
Beispiel #3
0
        private static void Run(String username, String deck, String serverIP, int serverPort, String password)
        {
            Rand = new Random();
            CardsManager.Init();
            DecksManager.Init();

            // Start two clients and connect them to the same room. Which deck is gonna win?
            GameClient clientA = new GameClient(username, deck, serverIP, serverPort, password);
            clientA.Start();
            while (clientA.Connection.IsConnected)
            {
                clientA.Tick();
                Thread.Sleep(1);
            }
        }
Beispiel #4
0
        public GameBehavior(GameClient game)
        {
            Game = game;
            Connection = game.Connection;

            _packets = new Dictionary<StocMessage, Action<GamePacketReader>>();
            _messages = new Dictionary<GameMessage, Action<GamePacketReader>>();
            RegisterPackets();

            _room = new Room();
            _duel = new Duel();

            _ai = new GameAI(Game, _duel);
            _ai.Executor = DecksManager.Instantiate(_ai, _duel);
            Deck = Deck.Load(_ai.Executor.Deck);
        }
Beispiel #5
0
        private static void Run()
        {
            Init("cards.cdb");

            // Start two clients and connect them to the same server. Which deck is gonna win?
            GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 7911);
            GameClient clientB = new GameClient("Fire", "OldSchool", "127.0.0.1", 7911);
            clientA.Start();
            clientB.Start();
            while (clientA.Connection.IsConnected || clientB.Connection.IsConnected)
            {
                clientA.Tick();
                clientB.Tick();
                Thread.Sleep(1);
            }
        }
Beispiel #6
0
 private static void Run(string pseudo, string deck, string info)
 {
     #if !DEBUG
         GameClient clientA = new GameClient(pseudo, deck, "127.0.0.1", port, info);
     #endif
     #if DEBUG
     GameClient clientA = new GameClient(pseudo, deck, "127.0.0.1", port, info);
     #endif
     clientA.Start();
     Console.WriteLine("Connexion réussi au port : " + port + " Pseudo -> " + pseudo + " Deck -> " + deck);
     Game.Add(clientA);
 }
Beispiel #7
0
 private static void Run(string info)
 {
     int DeckNum = Rand.Next(11);
     #if !DEBUG
         GameClient clientA = new GameClient("Kaibot", Deck[DeckNum], "127.0.0.1", port, info);
     #endif
     #if DEBUG
     GameClient clientA = new GameClient("Kaibot", Deck[11], "127.0.0.1", port, info);
     #endif
     clientA.Start();
     Console.WriteLine("Connexion réussi au port : " + port + " Deck -> " + Deck[11]);
     Game.Add(clientA);
 }