Esempio n. 1
0
        public void Render(ColoredItem <IRenderable> main)
        {
            if (SConsole.CursorLeft != 0)
            {
                SConsole.WriteLine();
            }

            if (SConsole.BufferHeight < Height)
            {
                SConsole.BufferHeight = (int)Height;
                startRow = 0;
            }
            else if (SConsole.BufferHeight - SConsole.CursorTop < Height)
            {
                SConsole.Write(new String('\n', (int)(Height - 1)));
                startRow = (uint)SConsole.BufferHeight - Height;
            }
            else
            {
                startRow = (uint)SConsole.CursorTop;
            }

            characterBuffer = new Dictionary <(uint, uint), ColoredItem <char> >();

            mainBuffer = new Buffer
            {
                { new Area(0, 0, Height, Width), main }
            };
            mainBuffer.RePrint += RePrint;

            isInited = true;

            Print();
        }
Esempio n. 2
0
 public bool Equals(ColoredItem <T> other)
 {
     return(Background == other.Background &&
            Foreground == other.Foreground &&
            Item.Equals(other.Item));
 }