예제 #1
0
파일: Food.cs 프로젝트: aequabit/Snek
        /// <inheritdoc cref="IRenderable.RenderMap"/>
        public RenderMap RenderMap(bool compatibility = false)
        {
            var map = new RenderMap();

            map.Add(_positions[0], compatibility ? 'x' : '●');

            return(map);
        }
예제 #2
0
        /// <inheritdoc cref="IRenderable.RenderMap"/>
        public RenderMap RenderMap(bool compatibility = false)
        {
            var map = new RenderMap();

            // Calculate the location of the title bar
            for (var i = 0; i < _text.Length; i++)
            {
                map.Add(new Position(i, 0), _text[i]);
            }
            return(map);
        }
예제 #3
0
        /// <inheritdoc cref="IRenderable.RenderMap"/>
        public RenderMap RenderMap(bool compatibility = false)
        {
            var map = new RenderMap();

            // Calculate the location of the status bar
            for (var i = Console.BufferWidth - _text.Length - 1; i < Console.BufferWidth - 1; i++)
            {
                map.Add(new Position(i, Console.BufferHeight - 1), _text[i - Console.BufferWidth + _text.Length + 1]);
            }

            return(map);
        }
예제 #4
0
파일: Snake.cs 프로젝트: aequabit/Snek
        /// <inheritdoc cref="IRenderable.RenderMap"/>
        public RenderMap RenderMap(bool compatibility = false)
        {
            var map = new RenderMap();

            foreach (var position in _positions)
            {
                map.Add(position, compatibility ? '#' : '█');
            }

// Concept of different heads depending on the moving direction
//            var last = _locations.Last();
//            foreach (var location in _locations)
//            {
//                map.Add(location, compatibility ? '#' : '█');
//                if (location.X == last.X && location.Y == last.Y)
//                    switch (_direction)
//                    {
//                        case Direction.Down:
//                            map.Add(location, '▼');
//                            break;
//                        case Direction.Left:
//                            map.Add(location, '◀');
//                            break;
//                        case Direction.Right:
//                            map.Add(location, '▶');
//                            break;
//                        case Direction.Up:
//                            map.Add(location, '▲');
//                            break;
//                    }
//                else
//                    map.Add(location, '█');
//            }

            return(map);
        }