Player.ToString retuns IPlayer.Name
ServerDirector.GetPlayer() helper method added for getting a player from the server without providing access to the servers collection libraries. ConnectState.Render() has some test code used when writing ServerDirector.GetPlayer() Started converting ConnectedPlayer and ConnectedThread collections to a single Dictionary collection. Not migrating everything to it until helper methods are finished.
This commit is contained in:
parent
ca97b9c439
commit
f977376ac3
6 changed files with 54 additions and 18 deletions
|
@ -9,12 +9,15 @@ namespace WinPC.Engine.Core
|
|||
public Socket Connection { get; private set; }
|
||||
public IState CurrentState { get; private set; }
|
||||
|
||||
public List<byte> buffer = new List<byte>();
|
||||
public List<byte> buffer = new List<byte>();
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public Player(IState initialState, Socket connection)
|
||||
{
|
||||
Connection = connection;
|
||||
CurrentState = initialState;
|
||||
Name = "Player";
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
|
@ -26,5 +29,10 @@ namespace WinPC.Engine.Core
|
|||
{
|
||||
CurrentState = state;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue