* IPlayer - Connection and Buffer properties added along with SwitchState(IState) method
* Switched the ServerDirector over from using two List Collections to maintain Client Threads and Player instances into a single Dictionary. Required adjusting the majority of the existing Types, but should now be functional. Need to still add some safety checks for null references since we are now passing a reference Type around.
This commit is contained in:
parent
f977376ac3
commit
24c9fae4f5
7 changed files with 59 additions and 62 deletions
|
@ -7,16 +7,18 @@ namespace WinPC.Engine.Commands
|
|||
{
|
||||
private ServerDirector Director { get; set; }
|
||||
private IState NewState { get; set; }
|
||||
private int Index { get; set; }
|
||||
public SwitchStateCommand(ServerDirector director, IState newState, int index)
|
||||
private IPlayer player { get; set; }
|
||||
|
||||
public SwitchStateCommand(ServerDirector director, IState newState, IPlayer connectedPlayer)
|
||||
{
|
||||
Director = director;
|
||||
NewState = newState;
|
||||
player = connectedPlayer;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
Director.ConnectedPlayers[Index].SwitchState(NewState);
|
||||
player.SwitchState(NewState);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue