Beispiel #1
0
        /// <summary>
        /// Create's a rendering console for this grid to be rendered on.
        /// </summary>
        /// <param name="viewport"></param>
        /// <param name="font"></param>
        /// <returns></returns>
        public void InitializeRenderer()
        {
            if (_cells.Any(a => a == null))
            {
                throw new Exception("Please initialize the grid first.");
            }

            _renderConsole.SetSurface(_cells, Width, Height);
            _renderConsole.IsDirty = true;

            foreach (var entity in _entities)
            {
                _renderConsole.Children.Add(entity);
            }
        }
Beispiel #2
0
 public void RenderObject(Console console)
 {
     console.SetSurface(Cells, GridSizeX, GridSizeY);
 }