* 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.
24 lines
No EOL
649 B
C#
24 lines
No EOL
649 B
C#
using WinPC.Engine.Abstract.Core;
|
|
using WinPC.Engine.Directors;
|
|
|
|
namespace WinPC.Engine.Commands
|
|
{
|
|
public class SwitchStateCommand : ICommand
|
|
{
|
|
private ServerDirector Director { get; set; }
|
|
private IState NewState { get; set; }
|
|
private IPlayer player { get; set; }
|
|
|
|
public SwitchStateCommand(ServerDirector director, IState newState, IPlayer connectedPlayer)
|
|
{
|
|
Director = director;
|
|
NewState = newState;
|
|
player = connectedPlayer;
|
|
}
|
|
|
|
public void Execute()
|
|
{
|
|
player.SwitchState(NewState);
|
|
}
|
|
}
|
|
} |