示例#1
0
        public void JoinGameLocal(PlayerType playerTypeOne, string playerNameOne, PlayerType playerTypeTwo, string playerNameTwo)
        {
            OthelloPlayerClient player1 = new OthelloPlayerClient(playerTypeOne, playerNameOne);
            OthelloPlayerClient player2 = new OthelloPlayerClient(playerTypeTwo, playerNameTwo);

            JoinGameLocal(player1, player2);
        }
示例#2
0
        public void JoinGameOnline(OthelloPlayerClient player, BattleType battleType)
        {
            GameType    = GameType.Online;
            gameHandler = new OnlineGameHandler();
            gameHandler.SetOrderHandler(this);

            (gameHandler as OnlineGameHandler).JoinGame(player, battleType);
        }
示例#3
0
        public void JoinGameLocal(OthelloPlayerClient player1, OthelloPlayerClient player2)
        {
            GameType    = GameType.Local;
            gameHandler = new LocalGameHandler();
            gameHandler.SetOrderHandler(this);

            (gameHandler as LocalGameHandler).JoinGame(player1, player2);
        }
示例#4
0
        public override void Load()
        {
            var save    = SaveFile.Load();
            var player1 = new OthelloPlayerClient(PlayerType.Human, save.Player1Name);
            var player2 = new OthelloPlayerClient(PlayerType.Human, save.Player2Name);

            this.LoadGame(player1, player2);
        }
示例#5
0
        static void Main(string[] args)
        {
            OthelloPlayerClient client1 = new OthelloPlayerClient(PlayerType.Human, "Me");
            OthelloPlayerClient client2 = new OthelloPlayerClient(PlayerType.Human, "eM");

            // Register clients to applicationManager
            ApplicationManager.Instance.JoinGameLocal(client1, client2);

            // Search, ready, etc
            //ApplicationManager.Instance.LaunchGame();

            // Wait
            Console.ReadLine();
        }
示例#6
0
        public void JoinGame(OthelloPlayerClient player, BattleType battleType)
        {
            player1 = player;
            player2 = new RemotePlayerData()
            {
                Name       = "[DEFAULT]",
                AvatarId   = 15,
                PlayerType = battleType == BattleType.AgainstPlayer ? PlayerType.Human : PlayerType.AI
            };

            player1.SetOrderHandler(this);

            player1.Connect(GameType);
            Thread.Sleep(1000);
            player1.Register();
        }
示例#7
0
        public void JoinGame(OthelloPlayerClient player1, OthelloPlayerClient player2)
        {
            this.player1        = player1;
            this.player2        = player2;
            duplicatedGameEnded = false;

            player1.SetOrderHandler(this);
            player2.SetOrderHandler(this);

            player1.Connect(GameType);
            player2.Connect(GameType);

            Thread.Sleep(250);

            player1.Register();
            player2.Register();
        }
示例#8
0
        public void JoinGameOnline(PlayerType playerType, string playerName, BattleType battleType)
        {
            OthelloPlayerClient player = new OthelloPlayerClient(playerType, playerName);

            JoinGameOnline(player, battleType);
        }
示例#9
0
 public void LoadGame(OthelloPlayerClient player1, OthelloPlayerClient player2)
 {
     load = true;
     JoinGame(player1, player2);
 }