nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::LandMap Class Reference

#include <map.h>

Public Member Functions

 LandMap ()=default
 ~LandMap ()
 LandMap (const LandMap &)=delete
LandMap & operator= (const LandMap &)=delete
void Build (const Terrain &terrain, int land)
 Draws the land into the texture, in place of the last one.
bool DrawMinimap (const std::vector< Figure > &figures, uint32_t target, std::optional< Vector3 > destination, float heading, MinimapTurn turn)
float minimap_bottom () const
int zoom () const
void set_zoom (int zoom)
std::optional< Place > DrawMap (const std::vector< Figure > &figures, uint32_t target, std::optional< Vector3 > destination, bool *open) const

Static Public Attributes

static constexpr std::array< float, 3 > kZooms = {25.0f, 45.0f, 80.0f}
 In metres from you to the minimap's rim, at each of its zooms.

Detailed Description

A land seen from above, north up: its ground in the land's colours, shaded by its slopes, its sea and its trees, drawn once into a texture as the land is built. The minimap, round, in the top right, shows what's around you, and the map, on M, the whole land, with whoever's near you on both.

Definition at line 30 of file map.h.

Constructor & Destructor Documentation

◆ LandMap() [1/2]

nanommo::LandMap::LandMap ( )
default

◆ ~LandMap()

nanommo::LandMap::~LandMap ( )

Definition at line 263 of file map.cc.

◆ LandMap() [2/2]

nanommo::LandMap::LandMap ( const LandMap & )
delete

Member Function Documentation

◆ Build()

void nanommo::LandMap::Build ( const Terrain & terrain,
int land )

Draws the land into the texture, in place of the last one.

Definition at line 324 of file map.cc.

◆ DrawMap()

std::optional< Place > nanommo::LandMap::DrawMap ( const std::vector< Figure > & figures,
uint32_t target,
std::optional< Vector3 > destination,
bool * open ) const

The map, in a window of its own, while open is true; its close button sets it to false. Returns the place you clicked on, to walk to.

Definition at line 453 of file map.cc.

◆ DrawMinimap()

bool nanommo::LandMap::DrawMinimap ( const std::vector< Figure > & figures,
uint32_t target,
std::optional< Vector3 > destination,
float heading,
MinimapTurn turn )

The minimap, with the monster you picked, by its id, and where you're walking to, if you are, turned to the heading the camera looks along if the player chose that. Scrolling over it, or its buttons, zoom in and out. Returns true when its map button's clicked.

Definition at line 342 of file map.cc.

◆ minimap_bottom()

float nanommo::LandMap::minimap_bottom ( ) const
inline

How far down the screen the minimap reaches, in points, for what goes under it.

Definition at line 54 of file map.h.

◆ operator=()

LandMap & nanommo::LandMap::operator= ( const LandMap & )
delete

◆ set_zoom()

void nanommo::LandMap::set_zoom ( int zoom)

Definition at line 338 of file map.cc.

◆ zoom()

int nanommo::LandMap::zoom ( ) const
inline

Definition at line 56 of file map.h.

Member Data Documentation

◆ kZooms

std::array<float, 3> nanommo::LandMap::kZooms = {25.0f, 45.0f, 80.0f}
staticconstexpr

In metres from you to the minimap's rim, at each of its zooms.

Definition at line 33 of file map.h.


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