public Player(Game game, YGOClient client) { Game = game; Type = (int)PlayerType.Undefined; State = PlayerState.None; _client = client; }
public void AddClient(YGOClient client) { _clients.Add(client); Player player = new Player(Game, client); client.PacketReceived += packet => player.Parse(packet); client.Disconnected += packet => player.OnDisconnected(); }
public void Start() { Connection = new YGOClient(); _behavior = new GameBehavior(this); Connection.Connected += OnConnected; Connection.PacketReceived += OnPacketReceived; Connection.Connect(IPAddress.Parse(_serverHost), _serverPort); }