public NPlayer(string _name, Socket socket) { this.name = _name; handler = socket.Accept(); Console.WriteLine("Accepted Socket"); networkStream = new NetworkStream(handler); StreamWriter writer = new StreamWriter(networkStream); StreamReader reader = new StreamReader(networkStream); this.relay = new NetworkRelay(writer, reader); Console.WriteLine("Got the stream setup"); this.playerState = State.start; }
public PlayerProxy(IPlayer player, string c, StreamWriter writer, StreamReader reader) { if (!Constants.colors.Contains(c)) { throw new ArgumentException("Color not allowed"); } Hand = new List <Tile>(); iplayer = player; Color = c; networkRelay = new NetworkRelay(writer, reader); Console.WriteLine("Got the streams set up for proxy player"); GameFinished = false; }