Пример #1
0
 public StepAction(ActionType type, IInteract subject, Point position, Color color)
 {
     Type        = type;
     Subject     = subject;
     Position    = position;
     CurrentStep = StepCounter.GetInstance().GetCounter();
     Color       = color;
 }
Пример #2
0
        /// <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);
        }
Пример #3
0
 public static StepCounter GetInstance()
 {
     return(_instance ?? (_instance = new StepCounter()));
 }