Пример #1
0
 public override void Apply(World w)
 {
     if (--_delayCounter == 0)
     {
         var entity = (IEntityHasColor)Entity;
         entity.Color = entity.Color == FirstColor ? SecondColor : FirstColor;
         _delayCounter = _delay;
     }
 }
Пример #2
0
        public static void Main(string[] args)
        {
            var mapStr =
            @"######
            #    #
            #    #
            #    #
            #    #
            #    #
            ######";
            Console.CursorVisible = false;

            var w = new World();
            w.Map = Map.LoadFromString(mapStr);
            var ent = new TestEntity("test1", new Point(2, 2), ConsoleColor.Red);
            var eff = new ColorBlinkEntityEffect(ent, ent.Color, ConsoleColor.Blue, World.SecondTick(5));

            w.AddEntity(ent);
            w.AddEffect(eff);

            w.Start();
        }
Пример #3
0
 public abstract void Apply(World w);