public static Oponent Create(OponentType oponentType) { Oponent oponent; switch (oponentType) { case OponentType.human: oponent = new Player(); break; case OponentType.computer: oponent = new ComputerOponent(); break; case OponentType.humanLAN: oponent = new OponentLAN(); break; default: Debug.LogError("Unknown oponent"); oponent = null; break; } return(oponent); }
public void InitMyPlayer(int id) { Debug.LogError($"Client: Initing my player {id} {gameObject.name}", gameObject); Oponent oponentRole = id == 0 ? GameManager.instance.player : GameManager.instance.computer; player.Create((TileValue)1 + id); player = oponentRole as OponentLAN; player.inTurn = id == 1; player.player = this; }