public StepAction(ActionType type, IInteract subject, Point position, Color color) { Type = type; Subject = subject; Position = position; CurrentStep = StepCounter.GetInstance().GetCounter(); Color = color; }
/// <summary> /// Выполнить один шаг игрового мира. /// </summary> /// <returns>Новый мир.</returns> public IList <IStepable> Step() { var newWorld = new List <IStepable>(); foreach (var elem in currentWorld) { elem.Step(currentWorld, newWorld); } StepCounter.GetInstance().Inc(); currentWorld = newWorld; return(newWorld); }
public static StepCounter GetInstance() { return(_instance ?? (_instance = new StepCounter())); }