rescuecore.tools.mapgenerator
Class BlocksBuildingGenerator

java.lang.Object
  extended byrescuecore.tools.mapgenerator.BlocksBuildingGenerator
All Implemented Interfaces:
BuildingGenerator
Direct Known Subclasses:
BasicBuildingGenerator

public abstract class BlocksBuildingGenerator
extends java.lang.Object
implements BuildingGenerator

An abstract class that provides functionality for adding buildings to a RescueMap one city block at a time.


Constructor Summary
BlocksBuildingGenerator()
           
 
Method Summary
 void addBuildings(RescueMap rm, int uniformity, int buildDensity, java.util.Random rand)
          Adds the buildings.
protected abstract  int[][][] fillBlock(RescueMap rm, int[] block, int buildDensity, java.util.Random rand)
          Give a list of buildings for a block.
protected abstract  int[][][] fillOuterBlock(RescueMap rm, int[] block, int buildDensity, java.util.Random rand)
          Give a list of buildings for the outside of the city.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlocksBuildingGenerator

public BlocksBuildingGenerator()
Method Detail

addBuildings

public void addBuildings(RescueMap rm,
                         int uniformity,
                         int buildDensity,
                         java.util.Random rand)
Adds the buildings.

Specified by:
addBuildings in interface BuildingGenerator
Parameters:
rm - The RescueMap to add to.
uniformity - The regularity amongst buildings.
buildDensity - The density of the buildings.
rand - The random number generator.

fillBlock

protected abstract int[][][] fillBlock(RescueMap rm,
                                       int[] block,
                                       int buildDensity,
                                       java.util.Random rand)
Give a list of buildings for a block. This should not do the adding of buildings.

Parameters:
rm - The RescueMap containing the block.
block - A list of nodes in anti-clockwise order around the block.
buildDensity - The density of buildings to add.
rand - The random number generator.
Returns:
Buildings to add as an array of form [building][apex][coordinate]

fillOuterBlock

protected abstract int[][][] fillOuterBlock(RescueMap rm,
                                            int[] block,
                                            int buildDensity,
                                            java.util.Random rand)
Give a list of buildings for the outside of the city.

Parameters:
rm - The RescueMap containing the block.
block - A list of nodes in anti-clockwise order around the block.
buildDensity - The density of buildings to add.
rand - The random number generator.
Returns:
Buildings to add as an array of form [building][apex][coordinate]