17 lines
494 B
C#
17 lines
494 B
C#
|
|
using Chessistics.Engine.Events;
|
||
|
|
using Chessistics.Engine.Model;
|
||
|
|
|
||
|
|
namespace Chessistics.Engine.Commands;
|
||
|
|
|
||
|
|
public abstract class WorldCommand : IWorldCommand
|
||
|
|
{
|
||
|
|
public void Apply(BoardState state, List<IWorldEvent> changeList)
|
||
|
|
{
|
||
|
|
AssertApplicationConditions(state);
|
||
|
|
state.ApplyCommand(DoApply, changeList);
|
||
|
|
}
|
||
|
|
|
||
|
|
protected abstract void DoApply(BoardState state, List<IWorldEvent> changeList);
|
||
|
|
public abstract void AssertApplicationConditions(BoardState state);
|
||
|
|
}
|