Пример #1
0
        public override Buffer Render(uint height, uint width)
        {
            Buffer buffer = new Buffer();

            if (game.NextPiece is Piece nextPiece && nextPiece != Piece.Empty)
            {
                uint offset = nextPiece == Piece.I || nextPiece == Piece.O ? 1u : 2u;
                foreach (var(x, y) in nextPiece.GetOffsets(0))
                {
                    buffer[((uint)y, (uint)(x + 1) * 2 + offset)]     = '█'.WithColors(foreground: PlayComponent.PieceColorMap[nextPiece]);
Пример #2
0
        public override Buffer Render(uint height, uint width)
        {
            Buffer buffer = new Buffer();

            if (game.Floating.HasValue)
            {
                try
                {
                    foreach (var(x, y) in game.GetPositionsOfPiece(y: game.PreviewDropY()))
                    {
                        buffer[((uint)y - 20, (uint)x * 2)]     = '\u2591'.WithColors(foreground: PieceColorMap[game.Floating.Value.piece]);