Game Develop Core: gd::Instruction Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | List of all members
gd::Instruction Class Reference
Events ( Classes defining the event system and some tools associated with events )

An instruction is a member of an event: It can be a condition or an action. More...

`#include <Instruction.h>`

## Public Member Functions

| Instruction (std::string type_="")
| Instruction (std::string type_, const std::vector< gd::Expression > &parameters_, bool inverted=false)
std::string | GetType () const
void | SetType (const std::string &newType)
bool | IsInverted () const
void | SetInverted (bool inverted_)
const gd::Expression & | GetParameter (unsigned int index) const
gd::Expression & | GetParameter (unsigned int index)
const std::vector < gd::Expression > & | GetParameters () const
void | SetParameters (const std::vector< gd::Expression > &val)
void | SetParameter (unsigned int nb, const gd::Expression &val)
const std::vector< Instruction > & | GetSubInstructions () const
std::vector< Instruction > & | GetSubInstructions ()
void | SetSubInstructions (const std::vector< Instruction > &subInstructions_)

## Public Attributes

Rendering
Members related to the instruction rendering in an event editor.
bool | renderedHeightNeedUpdate
| True if the instruction height may have changed and must be computed again.
unsigned int | renderedHeight
| Height of the instruction rendered in an event editor.
bool | selected
| True if selected in an event editor.

## Detailed Description

An instruction is a member of an event: It can be a condition or an action.

An instruction has a type, which define what it does, and some parameters. It can also be set as inverted ( when the instruction is a condition ) and it can have sub instructions. This class does nothing particular except storing these data.

See Also
  gd::BaseEvent

## Constructor & Destructor Documentation

gd::Instruction::Instruction | ( | std::string | type_ = `""`) |  |

Default constructor: Construct an empty instruction

gd::Instruction::Instruction | ( | std::string | type_,
|  | const std::vector< gd::Expression > & | parameters_,
|  | bool | inverted = `false`
| ) |  |

Main constructor

## Member Function Documentation

const gd::Expression & gd::Instruction::GetParameter | ( | unsigned int | index) |  | const

Access a parameter. Return a bad expression if the parameter requested does not exists.

Returns
  The current value of the parameter

gd::Expression & gd::Instruction::GetParameter | ( | unsigned int | index) |  |

Access a parameter. Return a bad expression if the parameter requested does not exists.

Returns
  The current value of the parameter

const std::vector< gd::Expression >& gd::Instruction::GetParameters | ( | ) |  | const

inline

Get a reference to the std::vector containing the parameters.

Returns
  A std::vector of string containing parameters

const std::vector< Instruction >& gd::Instruction::GetSubInstructions | ( | ) |  | const

inline

Return a reference to the vector containing sub instructions

std::vector< Instruction >& gd::Instruction::GetSubInstructions | ( | ) |  |

inline

Return a reference to the vector containing sub instructions

std::string gd::Instruction::GetType | ( | ) |  | const

inline

Return the type of the instruction. The type is used

Returns
  The type of the instruction

bool gd::Instruction::IsInverted | ( | ) |  | const

inline

Return true if the condition is inverted

Returns
  true if the condition is inverted

void gd::Instruction::SetInverted | ( | bool | inverted_) |  |

inline

Set if the instruction is inverted or not.

Parameters

  inverted | true if the condition must be set as inverted

void gd::Instruction::SetParameter | ( | unsigned int | nb,
|  | const gd::Expression & | val
| ) |  |

Change a particular parameter

Parameters

  nb | The parameter number
  val | The new value of the parameter

void gd::Instruction::SetParameters | ( | const std::vector< gd::Expression > & | val) |  |

inline

Replace all the parameters by new ones.

Parameters

  val | A std::vector of string containing the parameters

void gd::Instruction::SetSubInstructions | ( | const std::vector< Instruction > & | subInstructions_) |  |

inline

Change sub instructions

void gd::Instruction::SetType | ( | const std::string & | newType) |  |

inline

Change the instruction type

Parameters

  val | New value to set

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

- Instruction.h
- Instruction.cpp