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); }
public void JoinGameOnline(OthelloPlayerClient player, BattleType battleType) { GameType = GameType.Online; gameHandler = new OnlineGameHandler(); gameHandler.SetOrderHandler(this); (gameHandler as OnlineGameHandler).JoinGame(player, battleType); }
public void JoinGameLocal(OthelloPlayerClient player1, OthelloPlayerClient player2) { GameType = GameType.Local; gameHandler = new LocalGameHandler(); gameHandler.SetOrderHandler(this); (gameHandler as LocalGameHandler).JoinGame(player1, player2); }
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); }
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(); }
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(); }
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(); }
public void JoinGameOnline(PlayerType playerType, string playerName, BattleType battleType) { OthelloPlayerClient player = new OthelloPlayerClient(playerType, playerName); JoinGameOnline(player, battleType); }
public void LoadGame(OthelloPlayerClient player1, OthelloPlayerClient player2) { load = true; JoinGame(player1, player2); }