JugiMap Framework
Parameter Struct Reference

The Parameter struct defines a pair name : value. More...

#include <jmCommon.h>

Static Public Member Functions

static bool Exists (const std::vector< Parameter > &parameters, const std::string &name, const std::string &value="")
 Searches for a parameter with the given name and value in the parameters. If the value is not specified it searches only for the name. If a parameter is found returns true; otherwise returns false. More...
 
static std::string GetValue (const std::vector< Parameter > &parameters, const std::string &name, const std::string &defaultValue="")
 Searches for a parameter with the given name in the parameters. If found returns its value, otherwise returns the given defaultValue. More...
 
static int GetIntValue (const std::vector< Parameter > &parameters, const std::string &name, int defaultValue=0)
 Searches for a parameter with the given name in the parameters. If found returns its value converted to integer, otherwise returns the given defaultValue. More...
 
static float GetFloatValue (const std::vector< Parameter > &parameters, const std::string &name, float defaultValue=0.0)
 Searches for a parameter with the given name in the parameters. If found returns its value converted to float, otherwise returns the given defaultValue. More...
 

Public Attributes

std::string name
 The name of this parameter. More...
 
std::string value
 The value of this parameter. More...
 
int kind = -1
 The paramters kind as defined in JugiMap editor. This value is used at the map loading and has no real purpose. More...
 

Detailed Description

The Parameter struct defines a pair name : value.

The Parameter struct represents a paramater from JugiMap Editor.

Member Function Documentation

◆ Exists()

bool Exists ( const std::vector< Parameter > &  parameters,
const std::string &  name,
const std::string &  value = "" 
)
static

Searches for a parameter with the given name and value in the parameters. If the value is not specified it searches only for the name. If a parameter is found returns true; otherwise returns false.

◆ GetValue()

std::string GetValue ( const std::vector< Parameter > &  parameters,
const std::string &  name,
const std::string &  defaultValue = "" 
)
static

Searches for a parameter with the given name in the parameters. If found returns its value, otherwise returns the given defaultValue.

◆ GetIntValue()

int GetIntValue ( const std::vector< Parameter > &  parameters,
const std::string &  name,
int  defaultValue = 0 
)
static

Searches for a parameter with the given name in the parameters. If found returns its value converted to integer, otherwise returns the given defaultValue.

◆ GetFloatValue()

float GetFloatValue ( const std::vector< Parameter > &  parameters,
const std::string &  name,
float  defaultValue = 0.0 
)
static

Searches for a parameter with the given name in the parameters. If found returns its value converted to float, otherwise returns the given defaultValue.

Member Data Documentation

◆ name

std::string name

The name of this parameter.

◆ value

std::string value

The value of this parameter.

◆ kind

int kind = -1

The paramters kind as defined in JugiMap editor. This value is used at the map loading and has no real purpose.


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