コード例 #1
0
    static void Main(string[] args)
    {
        int mapWidth, mapHeight, fillPercent;

        if (args.Length < 3)
        {
            Console.WriteLine("Usage: *.exe <width> <height> <fill%>");
            return;
        }
        else
        {
            mapWidth    = Int32.Parse(args[0]);
            mapHeight   = Int32.Parse(args[1]);
            fillPercent = Int32.Parse(args[2]);
        }

        CaveGenerator caveGenerator = new CaveGenerator();
        Renderer      renderer      = new Renderer();
        ImageRenderer imageRenderer = new ImageRenderer();

        int[] playerPos = { 0, 0 };

        byte[,] mapContent = new byte[mapWidth, mapHeight];
        bool[,] map        = new bool[mapWidth, mapHeight];

        caveGenerator.GenerateCave(ref map, ref mapContent, 2, fillPercent);
        // caveGenerator.SpawnPlayer(ref map, ref mapContent, ref playerPos);

        // renderer.DrawMap(ref map, ref mapContent);
        Console.WriteLine("Rendering image...");
        imageRenderer.DrawMap(ref mapContent);

        Console.WriteLine("Done.");
        return;
    }