Esempio n. 1
0
        public Generator(int size, uint cityId)
        {
            rand = new Random();
            city = new Block[20, 20];
            seed = new Block.IdGenerator(cityId);

            CitySquareBlock centerBlock = new CitySquareBlock(rand, seed, city, 10, 10);

            centerBlock.Generate(rand, 75);

            centerBlock.GenerateCityBuildings(rand);

            //for (int y = 0; y < city.GetLength(1); y++) {
            //    for (int x = 0; x < city.GetLength(0); x++) {
            //        Block block = city[x, y];

            //        if (block != null)
            //            Console.Write(block.StrShape);
            //        else
            //            Console.Write(" ");

            //        //CitySquareBlock sqBlock = block as CitySquareBlock;

            //        //if (sqBlock != null) {
            //        //    Console.Write("+");
            //        //} else {
            //        //    StreetBlock sBlock = block as StreetBlock;
            //        //    if (sBlock != null) {
            //        //        Console.Write((sBlock.Orientation == Orientation.Vertical) ? "|" : "-");
            //        //    } else {
            //        //        CityBuildingBlock bBlock = block as CityBuildingBlock;
            //        //        if (bBlock != null) {
            //        //            Console.Write("#");
            //        //        } else
            //        //            Console.Write(" ");
            //        //    }
            //        //}
            //    }
            //    Console.WriteLine();
            //}
        }
Esempio n. 2
0
 public CitySquareBlock(Random rand, Block.IdGenerator seed, Block[,] city, int x, int y)
     : base(rand, seed, Orientation.None, city, x, y)
 {
 }
Esempio n. 3
0
 public StreetBlock(Random rand, Block.IdGenerator seed, Orientation orientation, Block[,] city, int x, int y)
     : base(rand, seed, orientation, city, x, y)
 {
 }