bwmodel
A modeling environment for Minecraft Bedwars
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
bwmodel::Map Class Referencefinal

#include <map.h>

Inheritance diagram for bwmodel::Map:
bwmodel::GridInterface< RegionSet, blocks_t >

Public Member Functions

bool update_region (blocks_t x, blocks_t y, RegionSet regions)
 
RegionSet regions_at (blocks_t x, blocks_t y) const
 
- Public Member Functions inherited from bwmodel::GridInterface< RegionSet, blocks_t >
blocks_t width () const
 
blocks_t height () const
 

Static Public Member Functions

static std::unique_ptr< Mapload_from (const std::string &path)
 

Protected Member Functions

const Grid< RegionSet > & backing () const override
 
- Protected Member Functions inherited from bwmodel::GridInterface< RegionSet, blocks_t >
void assert_grid_invariant ()
 

Detailed Description

Defines the regions in a bedwars map.

Member Function Documentation

◆ backing()

const Grid< RegionSet > & bwmodel::Map::backing ( ) const
overrideprotectedvirtual

Internally retrieves the backing (nested vector) for helper function generation in GridInterface.

Implements bwmodel::GridInterface< RegionSet, blocks_t >.

◆ load_from()

std::unique_ptr< Map > bwmodel::Map::load_from ( const std::string & path)
static

Loads a map from a file, idiomatically with extension .bwmap.

Exceptions
MapLoadErroron parsing error.

◆ regions_at()

RegionSet bwmodel::Map::regions_at ( blocks_t x,
blocks_t y ) const

Returns the region properties at the given (x, y) coordinates.

Returns
RegionSet::INVALID if out of range.

◆ update_region()

bool bwmodel::Map::update_region ( blocks_t x,
blocks_t y,
RegionSet regions )

Adds the regions given by regions to the the given (x, y) coordinates.

Returns
Whether the addition was in-range.

The documentation for this class was generated from the following files: