예제 #1
0
        /// <summary>
        /// Draw the map
        /// </summary>
        public void Draw()
        {
            Console.Clear();
            var origRow = Console.CursorTop;
            var origCol = Console.CursorLeft;

            for (int y = 0; y < Height; y++)
            {
                for (int x = 0; x < Width; x++)
                {
                    Tiles[y, x].Draw();
                }
                Console.WriteLine();
            }
            Console.WriteLine($"Player {ThePlayer.Number} location: [{ThePlayer.X + 1}, {ThePlayer.Y + 1}]");

            ThePlayer.Draw();

            foreach (var m in Monsters)
            {
                m.Draw();
            }

            Console.SetCursorPosition(0, 0);
            foreach (var m in Monsters)
            {
                m.PerformAI();
            }
        }