Added SwitchStateCommand ability, Future (replace dual lists to single Dictionary)

This commit is contained in:
darxval_cp 2012-06-04 20:32:31 -07:00
parent a0c406d482
commit ca97b9c439
7 changed files with 69 additions and 3 deletions

View file

@ -0,0 +1,22 @@
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 int Index { get; set; }
public SwitchStateCommand(ServerDirector director, IState newState, int index)
{
Director = director;
NewState = newState;
}
public void Execute()
{
Director.ConnectedPlayers[Index].SwitchState(NewState);
}
}
}