Example #1
0
        public Model()
        {
            _rand       = new Random();
            Apple       = new PrintableEntity(new Point(30, 30), PrintableEntity.AppleColor, PrintableEntity.AppleChar);
            Snake       = new Snake(new Point(10, 10));
            PrintBuffer = new List <PrintableEntity>();

            UpdatePrintableBuffer();
        }
 public PrintableEntity(PrintableEntity entity) : this(entity.Coords, entity.Color, entity.Character)
 {
 }
Example #3
0
 /// <summary>
 /// Prints an entity in the terminal according to its
 /// properties
 /// </summary>
 /// <param name="entity"></param>
 private void PaintEntity(PrintableEntity entity)
 {
     Console.ForegroundColor = entity.Color;
     Console.SetCursorPosition(entity.Coords.X, entity.Coords.Y);
     Console.Write(entity.Character);
 }