Exemple #1
0
        private void RenderScreen(IRenderable entity)
        {
            StringBuilder sb = GetBlankScreen();

            foreach (var point in entity.SkinCoordinates.Keys)
            {
                var x = ((Point)point).X;
                var y = ((Point)point).Y;

                if (x < RenderWidth && y < RenderHeight)
                {
                    int strIndex   = (RenderWidth + 1) * ((int)y - 1) + (int)x;
                    var charToDraw = entity.GetSkinChar((int)x, (int)y);
                    sb.Replace(' ', charToDraw, strIndex, 1);
                }
            }

            Console.SetCursorPosition(0, 0);
            Console.Write(sb);
        }