C# Class DivineRightGame.LocalMapGenerator.LocalMapGenerator

Mostra file Open project: Haedrian/Divine-Right Class Usage Examples

Public Methods

Method Description
CreateBlueprint ( Maplet maplet ) : ].PlanningMapItemType[

Creates a Blueprint from a maplet

Fits ( PlanningMapItemType map, PlanningMapItemType maplet, bool edge, bool firstFit, int padding, int &startX, int &startY, PlanningMapItemType &newMap ) : bool

Determines whether a maplet will fit into a map, and if it does, where it fits

Fits ( PlanningMapItemType map, PlanningMapItemType maplet, int x, int y, PlanningMapItemType &newMap ) : bool

Determines whether a particular maplet with a fixed x and y coordiate will fit, and places it on the updated planning map if it does ONLY USE FOR ABSOLUTE POSITIONING

FuseMaps ( PlanningMapItemType map, PlanningMapItemType maplet, int startX, int startY ) : ].PlanningMapItemType[

Fuses the two maps together such that the maplet will reserve space for itself in the blueprint. This function assumes that the maps will fit and does not perform any checking. It is greatly recommended that you use Fits to invoke this function

GenerateEnemies ( MapBlock blocks, int enemyCount, string enemyType, DRObjects &actors, int level, int equipmentCost ) : ].MapBlock[

Generates enemies on the map.

GenerateMap ( int parentTileID, int parentWallID, Maplet maplet, bool preferSides, string actorType, OwningFactions owner, Actor &actors, MapletActorWanderArea &wAreas, MapletPatrolPoint &patrolRoutes, MapletFootpathNode &footpathNodes ) : ].MapBlock[

Generates a map based on the maplet assigned

GenerateVendor ( Actor newActor, MapletActor actor ) : void

Generates a vendor, adds the vendor details to the actor being created

JoinMaps ( MapBlock baseMap, MapBlock maplet, int startX, int startY ) : ].MapBlock[

Places the contents of the items in the maplet into the base map. Tiles must already have been set at this point, as this will only place mapitems.

UpdateVendorStock ( Actor actor ) : void

Updates the Vendor's stock to brand new stock

Private Methods

Method Description
NoDoubleWall ( PlanningMapItemType map, PlanningMapItemType maplet, int mapX, int mapY ) : bool

Checks whether this positioning would create a double wall

Method Details

CreateBlueprint() public method

Creates a Blueprint from a maplet
public CreateBlueprint ( Maplet maplet ) : ].PlanningMapItemType[
maplet DRObjects.LocalMapGeneratorObjects.Maplet
return ].PlanningMapItemType[

Fits() public method

Determines whether a maplet will fit into a map, and if it does, where it fits
public Fits ( PlanningMapItemType map, PlanningMapItemType maplet, bool edge, bool firstFit, int padding, int &startX, int &startY, PlanningMapItemType &newMap ) : bool
map PlanningMapItemType The original map
maplet PlanningMapItemType The maplet we are trying to introduce
edge bool If this is set to true, will try to put them on the edge. Otherwise will try to be compeltly random
firstFit bool If this is set to true, and edge is set to true, it will try to fit the object in the first place it can find
padding int
startX int Where the map will fit on the X coordinate
startY int Where the map will fit on the Y coordinate
newMap PlanningMapItemType What the map will look like with the maplet inside it. Will be equivalent to map if there is no fit
return bool

Fits() public method

Determines whether a particular maplet with a fixed x and y coordiate will fit, and places it on the updated planning map if it does ONLY USE FOR ABSOLUTE POSITIONING
public Fits ( PlanningMapItemType map, PlanningMapItemType maplet, int x, int y, PlanningMapItemType &newMap ) : bool
map PlanningMapItemType
maplet PlanningMapItemType
x int
y int
newMap PlanningMapItemType
return bool

FuseMaps() public method

Fuses the two maps together such that the maplet will reserve space for itself in the blueprint. This function assumes that the maps will fit and does not perform any checking. It is greatly recommended that you use Fits to invoke this function
public FuseMaps ( PlanningMapItemType map, PlanningMapItemType maplet, int startX, int startY ) : ].PlanningMapItemType[
map PlanningMapItemType The base map blueprint
maplet PlanningMapItemType The maplet blueprint
startX int Where on the x coordinate the maplet will begin
startY int Where on the Y coordinate the maplet will begin
return ].PlanningMapItemType[

GenerateEnemies() public method

Generates enemies on the map.
public GenerateEnemies ( MapBlock blocks, int enemyCount, string enemyType, DRObjects &actors, int level, int equipmentCost ) : ].MapBlock[
blocks DRObjects.MapBlock
enemyCount int
enemyType string
actors DRObjects
level int
equipmentCost int
return ].MapBlock[

GenerateMap() public method

Generates a map based on the maplet assigned
public GenerateMap ( int parentTileID, int parentWallID, Maplet maplet, bool preferSides, string actorType, OwningFactions owner, Actor &actors, MapletActorWanderArea &wAreas, MapletPatrolPoint &patrolRoutes, MapletFootpathNode &footpathNodes ) : ].MapBlock[
parentTileID int The ID of the tiles used in the parent maplet item
parentWallID int The wall that the parent has
maplet DRObjects.LocalMapGeneratorObjects.Maplet The maplet to generate
preferSides bool
actorType string The type of actors to generate
owner OwningFactions The owner of the map. Any maplet items which don't belong will be hidden
actors DRObjects.Actor The actors which we have generated
wAreas DRObjects.LocalMapGeneratorObjects.MapletActorWanderArea
patrolRoutes DRObjects.LocalMapGeneratorObjects.MapletPatrolPoint
footpathNodes DRObjects.LocalMapGeneratorObjects.MapletFootpathNode
return ].MapBlock[

GenerateVendor() public method

Generates a vendor, adds the vendor details to the actor being created
public GenerateVendor ( Actor newActor, MapletActor actor ) : void
newActor DRObjects.Actor
actor DRObjects.LocalMapGeneratorObjects.MapletActor
return void

JoinMaps() public method

Places the contents of the items in the maplet into the base map. Tiles must already have been set at this point, as this will only place mapitems.
public JoinMaps ( MapBlock baseMap, MapBlock maplet, int startX, int startY ) : ].MapBlock[
baseMap DRObjects.MapBlock The Base Map
maplet DRObjects.MapBlock The maplet items to place
startX int The x coordinate on the basemap where to start
startY int The y coordinate on the basemap where to start
return ].MapBlock[

UpdateVendorStock() public method

Updates the Vendor's stock to brand new stock
public UpdateVendorStock ( Actor actor ) : void
actor DRObjects.Actor
return void