Struct planetkit::globe::Globe [] [src]

pub struct Globe {
    pub gen: Gen,
    // some fields omitted
}

Fields

Methods

impl Globe
[src]

[src]

[src]

[src]

[src]

[src]

Copy shared cells owned by a chunk for any loaded downstream chunks that have an outdated copy.

Panics if the given chunk is not loaded.

[src]

Copy shared cells not owned by a chunk from any loaded upstream chunks that have a more current copy.

Panics if the given chunk is not loaded.

[src]

[src]

[src]

Most Chunkss will have an associated ChunkView. Indicate that the chunk (or something else affecting its visibility) has been modified since the view was last updated.

[src]

[src]

Add the given chunk to the globe.

This may have been freshly generated, or loaded from disk.

Panics

Panics if there was already a chunk loaded for the same chunk origin.

[src]

Remove the chunk at the given chunk origin. Returns the removed chunk.

Panics

Panics if there was no chunk loaded at the given chunk origin.

[src]

[src]

Ensures the specified chunk is present.

If the chunk is already present, then do nothing. Otherwise, the chunk may be either loaded from disk, or generated fresh if it has never been saved.

This pays no regard to preferred limits on the number of chunks that should be loaded, and chunks added through this mechanism may well be unloaded immediately the next time this system is invoked, making this only suitable for immediate actions.

impl<'a> Globe
[src]

[src]

[src]

[src]

[src]

impl Globe
[src]

[src]

Attempt to find dry land at surface level. See find_dry_land.

[src]

Attempt to find dry land near (above or below) the given pos.

A land cell position will only be returned if it has at least as many contiguous cells of air directly above it as specified by min_air_cells_above.

Returns None if no such cell can be found within the maximum distance given, e.g., if the highest land was below water, or our guess about where there should be land exposed to air turned out to be wrong.

Note that this returns the position of the cell found containing land, not the first cell above it containing air. If you are trying to find a suitable location to, e.g., spawn new entities, then you probably want to use the position one above the position returned by this function.

[src]

Find a random cell immediately above dry land. See find_dry_land.

This is useful for finding a suitable point on the surface of the planet to place new entities, e.g., the player character when choosing a random spawn point on the planet.

Returns None if no suitable cell could be found within the maximum number of attempts. Each attempt begins from a new random column.

[src]

Trait Implementations

impl Component for Globe
[src]

Associated storage type for this component.