The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
wfl::operator_expression Class Reference
Inheritance diagram for wfl::operator_expression:
Inheritance graph

Public Member Functions

 operator_expression (const std::string &op, expression_ptr left, expression_ptr right)
 
std::string str () const
 
- Public Member Functions inherited from wfl::formula_expression
 formula_expression (const std::string &name="")
 
virtual ~formula_expression ()
 
variant evaluate (const formula_callable &variables, formula_debugger *fdb=nullptr) const
 
std::string get_name () const
 

Private Types

enum  OP {
  AND, OR, NEQ, LTE,
  GTE, OP_CAT, OP_IN, GT ='>',
  LT ='<', EQ ='=', RAN ='~', ADD ='+',
  SUB ='-', MUL ='*', DIV ='/', ADDL,
  SUBL, MULL, DIVL, DICE ='d',
  POW ='^', MOD =''
}
 

Private Member Functions

variant execute (const formula_callable &variables, formula_debugger *fdb) const
 

Static Private Member Functions

static int dice_roll (int num_rolls, int faces)
 

Private Attributes

OP op_
 
std::string op_str_
 
expression_ptr left_
 
expression_ptr right_
 

Detailed Description

Definition at line 697 of file formula.cpp.

Member Enumeration Documentation

◆ OP

Enumerator
AND 
OR 
NEQ 
LTE 
GTE 
OP_CAT 
OP_IN 
GT 
LT 
EQ 
RAN 
ADD 
SUB 
MUL 
DIV 
ADDL 
SUBL 
MULL 
DIVL 
DICE 
POW 
MOD 

Definition at line 803 of file formula.cpp.

Constructor & Destructor Documentation

◆ operator_expression()

wfl::operator_expression::operator_expression ( const std::string &  op,
expression_ptr  left,
expression_ptr  right 
)
inline

Definition at line 700 of file formula.cpp.

Member Function Documentation

◆ dice_roll()

static int wfl::operator_expression::dice_roll ( int  num_rolls,
int  faces 
)
inlinestaticprivate

Definition at line 792 of file formula.cpp.

References randomness::generator, and randomness::rng::get_random_int().

◆ execute()

variant wfl::operator_expression::execute ( const formula_callable variables,
formula_debugger fdb 
) const
inlineprivatevirtual

◆ str()

std::string wfl::operator_expression::str ( ) const
inlinevirtual

Implements wfl::formula_expression.

Definition at line 728 of file formula.cpp.

References s.

Member Data Documentation

◆ left_

expression_ptr wfl::operator_expression::left_
private

Definition at line 808 of file formula.cpp.

◆ op_

OP wfl::operator_expression::op_
private

Definition at line 806 of file formula.cpp.

◆ op_str_

std::string wfl::operator_expression::op_str_
private

Definition at line 807 of file formula.cpp.

◆ right_

expression_ptr wfl::operator_expression::right_
private

Definition at line 808 of file formula.cpp.


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