Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Functions | Variables
BlockID.cpp File Reference
#include "Globals.h"
#include "IniFile.h"
#include "Item.h"
#include "Mobs/Monster.h"
Include dependency graph for BlockID.cpp:

Go to the source code of this file.

Classes

class  cBlockIDMap
 
struct  cBlockIDMap::Comparator
 

Functions

int BlockStringToType (const AString &a_BlockTypeString)
 Translates a blocktype string into blocktype. More...
 
AString DamageTypeToString (eDamageType a_DamageType)
 Translates damage type constant to a string representation (built-in) More...
 
AString DimensionToString (eDimension a_Dimension)
 Translates a dimension enum to dimension string. More...
 
cItem GetIniItemSet (cIniFile &a_IniFile, const char *a_Section, const char *a_Key, const char *a_Default)
 Returns a cItem representing the item described in an IniFile's value; if the value doesn't exist, creates it with the provided default. More...
 
AString ItemToFullString (const cItem &a_Item)
 Translates a full item into a fully-specified string (including meta and count). More...
 
AString ItemToString (const cItem &a_Item)
 Translates a full item into a string. More...
 
AString ItemTypeToString (short a_ItemType)
 Translates itemtype into a string. More...
 
eDamageType StringToDamageType (const AString &a_DamageTypeString)
 Translates a damage type string to damage type. More...
 
eDimension StringToDimension (const AString &a_DimensionString)
 Translates a dimension string to dimension enum. More...
 
bool StringToItem (const AString &a_ItemTypeString, cItem &a_Item)
 Translates an itemtype string into an item. More...
 

Variables

static cBlockIDMap gsBlockIDMap
 

Function Documentation

int BlockStringToType ( const AString a_BlockTypeString)

Translates a blocktype string into blocktype.

Takes either a number or an items.ini alias as input. Returns -1 on failure.

Definition at line 218 of file BlockID.cpp.

AString DamageTypeToString ( eDamageType  a_DamageType)

Translates damage type constant to a string representation (built-in)

Translates damage type constant to a string representation (built-in).

Definition at line 368 of file BlockID.cpp.

AString DimensionToString ( eDimension  a_Dimension)

Translates a dimension enum to dimension string.

Takes an eDimension enum value and returns "Overworld" on failure.

Definition at line 336 of file BlockID.cpp.

cItem GetIniItemSet ( cIniFile a_IniFile,
const char *  a_Section,
const char *  a_Key,
const char *  a_Default 
)

Returns a cItem representing the item described in an IniFile's value; if the value doesn't exist, creates it with the provided default.

Definition at line 476 of file BlockID.cpp.

AString ItemToFullString ( const cItem a_Item)

Translates a full item into a fully-specified string (including meta and count).

If the ItemType is not recognized, the ItemType number is output into the string.

Definition at line 283 of file BlockID.cpp.

AString ItemToString ( const cItem a_Item)

Translates a full item into a string.

If the ItemType is not recognized, the ItemType number is output into the string.

Definition at line 257 of file BlockID.cpp.

AString ItemTypeToString ( short  a_ItemType)

Translates itemtype into a string.

If the type is not recognized, the itemtype number is output into the string.

Definition at line 270 of file BlockID.cpp.

eDamageType StringToDamageType ( const AString a_DamageTypeString)

Translates a damage type string to damage type.

Takes either a number or a damage type alias (built-in). Returns -1 on failure.

Definition at line 401 of file BlockID.cpp.

eDimension StringToDimension ( const AString a_DimensionString)

Translates a dimension string to dimension enum.

Takes either a number or a dimension alias (built-in). Returns dimOverworld on failure

Definition at line 294 of file BlockID.cpp.

bool StringToItem ( const AString a_ItemTypeString,
cItem a_Item 
)

Translates an itemtype string into an item.

Takes either a number, number^number, number:number or an items.ini alias as input. Returns true if successful.

Definition at line 238 of file BlockID.cpp.

Variable Documentation

cBlockIDMap gsBlockIDMap
static

Definition at line 193 of file BlockID.cpp.