PCG Module

Functions and values

Function or value Description

findAvailablePlaceForObject cellGrid (selectedObjectRow, selectedObjectInstance) randomIntGeneratorWithSeed

Full Usage: findAvailablePlaceForObject cellGrid (selectedObjectRow, selectedObjectInstance) randomIntGeneratorWithSeed

Parameters:
    cellGrid : CellGrid - The CellGrid representing the available cells for object placement
    selectedObjectRow : DataTableRow<'Value> - The DataTableRow representing the selected object
    selectedObjectInstance : ObjectVariant<'Value> - The ObjectVariant representing the selected instance of the object
    randomIntGeneratorWithSeed : int -> int -> int - The random integer generator with seed

Returns: (int * int) option Option type representing either the coordinates of the available cell or None if no suitable cell is found.

Finds an available place for a selected object.

cellGrid : CellGrid

The CellGrid representing the available cells for object placement

selectedObjectRow : DataTableRow<'Value>

The DataTableRow representing the selected object

selectedObjectInstance : ObjectVariant<'Value>

The ObjectVariant representing the selected instance of the object

randomIntGeneratorWithSeed : int -> int -> int

The random integer generator with seed

Returns: (int * int) option

Option type representing either the coordinates of the available cell or None if no suitable cell is found.

generateInterior cellGrid dataTable maximumAmountOfObjects placementFunction randomIntGeneratorWithSeed

Full Usage: generateInterior cellGrid dataTable maximumAmountOfObjects placementFunction randomIntGeneratorWithSeed

Parameters:
    cellGrid : CellGrid - The CellGrid representing the available cells for object placement
    dataTable : DataTable<'Value> - The DataTable containing objects and their variants
    maximumAmountOfObjects : int - The maximum number of objects to be placed
    placementFunction : DataTableRow<'Value> -> ObjectVariant<'Value> -> int -> int -> unit - The function responsible for placing objects on the grid
    randomIntGeneratorWithSeed : int -> int -> int - The random integer generator with seed

Generates room interior by placing objects from DataTable on a CellGrid using specified placement function.

cellGrid : CellGrid

The CellGrid representing the available cells for object placement

dataTable : DataTable<'Value>

The DataTable containing objects and their variants

maximumAmountOfObjects : int

The maximum number of objects to be placed

placementFunction : DataTableRow<'Value> -> ObjectVariant<'Value> -> int -> int -> unit

The function responsible for placing objects on the grid

randomIntGeneratorWithSeed : int -> int -> int

The random integer generator with seed

selectObjectToPlace dataTable randomIntGeneratorWithSeed

Full Usage: selectObjectToPlace dataTable randomIntGeneratorWithSeed

Parameters:
    dataTable : DataTable<'Value> - The DataTable containing objects and their variants
    randomIntGeneratorWithSeed : int -> int -> int - The random integer generator with seed

Returns: DataTableRow<'Value> * ObjectVariant<'Value> * int * int Tuple containing the selected object, its instance, the index in the DataTable, and the index of the selected variant.

Selects an object to place based on a DataTable and a random integer generator with seed.

dataTable : DataTable<'Value>

The DataTable containing objects and their variants

randomIntGeneratorWithSeed : int -> int -> int

The random integer generator with seed

Returns: DataTableRow<'Value> * ObjectVariant<'Value> * int * int

Tuple containing the selected object, its instance, the index in the DataTable, and the index of the selected variant.