Added SwitchStateCommand ability, Future (replace dual lists to single Dictionary)
This commit is contained in:
parent
a0c406d482
commit
ca97b9c439
7 changed files with 69 additions and 3 deletions
22
MudEngine/WinPC.Engine/Commands/SwitchStateCommand.cs
Normal file
22
MudEngine/WinPC.Engine/Commands/SwitchStateCommand.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue