Link Search Menu Expand Document

Data

Table of Contents

  1. CSWorldDataGenerateError(Exception)
  2. CSWorldDataGenerator
    1. __init__
    2. size()
    3. to_grid()
    4. coins()
    5. walls()

This submodule contains the world data generator code for the configuration system.

CSWorldDataGenerateError(Exception)

Could not generate the world data.

CSWorldDataGenerator

The base class for the world data generator for world maps.

The world data generator reads the given input string and returns a grid-like two-dimensional array for use with world manipulation or storage.

__init__

Construct the world data generator.

Arguments

  • data (str): The string containing the world’s data to parse. Defaults to an empty string.

size()

Get the size of the given world data grid.

Returns

  • dimensions (tuple): A tuple containing the number of rows and columns in the grid.

to_grid()

Get the world data as a world grid.

Returns

  • grid (CSGrid): A world grid containing the world data.

coins()

Get the world coin data.

Returns

  • grid (CSGrid): The world grid containing the coins.

walls()

Get the world wall data.

Returns

  • grid (CSGrid): The world grid containing the walls.