Constructor module

class Constructor.Constructor(wall)

Bases: object

The constructor handles the compilation and processing of information from the backend and the transition of that information into something that the front end can handle

Methods

generate_map(options)

Generates a map

assign_districts(regions, wall, city)

Assigns the provided regions a district

assign_district(reg, regions, wall, city)

Assigns the region a district

static assign_district(reg, regions, wall, options)

Assigns a district to a region based on Ratings

Parameters
optionsList of ints

User options

regRegion

Region to have a district assigned to it

regionsList of Regions

All of the Regions on the map

wallInfrastructure

The City wall

static assign_districts(regions, wall, options)

Assigns the provided regions a district at sudo-random order, taking into account the wall and city bounds

Parameters
optionsList of ints

Option input from user

regionsList of regions

Regions to have districts assigned

wallInfrastructure

The wall of the city

generate_map(options)

Generates a random map, with the provided options.

Parameters
optionslist of ints

The user options that control what districts are allowed, and if buildings are made

Returns
——-