Micropolis
tool.h File Reference

Defines tools, building properties, and tool effects for the Micropolis game. More...

#include <map>
#include <list>

Go to the source code of this file.

Classes

class  ToolEffects
 
class  BuildingProperties
 

Typedefs

typedef unsigned short MapValue
 
typedef unsigned short MapTile
 
typedef std::map< Position, MapValueWorldModificationsMap
 
typedef std::list< FrontendMessage * > FrontendMessages
 

Enumerations

enum  MapTileBits {
  PWRBIT = 0x8000 , CONDBIT = 0x4000 , BURNBIT = 0x2000 , BULLBIT = 0x1000 ,
  ANIMBIT = 0x0800 , ZONEBIT = 0x0400 , ALLBITS = ZONEBIT | ANIMBIT | BULLBIT | BURNBIT | CONDBIT | PWRBIT , LOMASK = 0x03ff ,
  BLBNBIT = BULLBIT | BURNBIT , BLBNCNBIT = BULLBIT | BURNBIT | CONDBIT , BNCNBIT = BURNBIT | CONDBIT
}
 
enum  EditingTool {
  TOOL_RESIDENTIAL , TOOL_COMMERCIAL , TOOL_INDUSTRIAL , TOOL_FIRESTATION ,
  TOOL_POLICESTATION , TOOL_QUERY , TOOL_WIRE , TOOL_BULLDOZER ,
  TOOL_RAILROAD , TOOL_ROAD , TOOL_STADIUM , TOOL_PARK ,
  TOOL_SEAPORT , TOOL_COALPOWER , TOOL_NUCLEARPOWER , TOOL_AIRPORT ,
  TOOL_NETWORK , TOOL_WATER , TOOL_LAND , TOOL_FOREST ,
  TOOL_COUNT , TOOL_FIRST = TOOL_RESIDENTIAL , TOOL_LAST = TOOL_FOREST
}
 

Detailed Description

Defines tools, building properties, and tool effects for the Micropolis game.

This header file includes definitions for various tools used in the game, along with the properties of buildings and the effects tools have on the game's world. It encompasses the core functionalities of tools, such as building, bulldozing, and querying, and their impact on the game's map and financial aspects. The classes and enumerations in this file form an integral part of the game's interaction mechanics, allowing players to modify and interact with the game world.

Definition in file tool.h.

Typedef Documentation

◆ FrontendMessages

typedef std::list<FrontendMessage *> FrontendMessages

List of messages to send to the frontend.

Definition at line 175 of file tool.h.

◆ MapTile

typedef unsigned short MapTile

Value of a tile in the map array excluding the MapTileBits (that is, just a value from #MapCharacters).

Definition at line 108 of file tool.h.

◆ MapValue

typedef unsigned short MapValue

Value of a tile in the map array incuding the MapTileBits.

Definition at line 101 of file tool.h.

◆ WorldModificationsMap

Set of modifications in the world accessible by position.

Definition at line 171 of file tool.h.

Enumeration Type Documentation

◆ EditingTool

Available tools.

These describe the wand values, the object dragged around on the screen.

Definition at line 142 of file tool.h.

◆ MapTileBits

Status bits of a map tile.

See also
MapTile MapCharacters MapTile MapValue
Todo:

ALLBITS should end with MASK.

Decide what to do with ANIMBIT (since sim-backend may not be the optimal place to do animation).

How many of these bits can be derived from the displayed tile?

Enumerator
PWRBIT 

bit 15, tile has power.

CONDBIT 

bit 14. tile can conduct electricity.

BURNBIT 

bit 13, tile can be lit.

BULLBIT 

bit 12, tile is bulldozable.

ANIMBIT 

bit 11, tile is animated.

ZONEBIT 

bit 10, tile is the center tile of the zone.

ALLBITS 

Mask for the bits-part of the tile.

LOMASK 

Mask for the Tiles part of the tile.

Definition at line 119 of file tool.h.