Public Member Functions | |
operator_expression (const std::string &op, expression_ptr left, expression_ptr right) | |
std::string | str () const |
![]() | |
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_ |
Definition at line 695 of file formula.cpp.
|
private |
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 801 of file formula.cpp.
|
inline |
Definition at line 698 of file formula.cpp.
|
inlinestaticprivate |
Definition at line 790 of file formula.cpp.
References randomness::generator, and randomness::rng::get_random_int().
|
inlineprivatevirtual |
Implements wfl::formula_expression.
Definition at line 734 of file formula.cpp.
References unit_abilities::ADD, wfl::add_debug_info(), wfl::variant::as_bool(), wfl::variant::as_int(), wfl::variant::build_range(), wfl::variant::concatenate(), unit_abilities::DIV, wfl::variant::list_elements_add(), wfl::variant::list_elements_div(), wfl::variant::list_elements_mul(), wfl::variant::list_elements_sub(), unit_abilities::MUL, and PLAIN_LOG.
|
inlinevirtual |
|
private |
Definition at line 806 of file formula.cpp.
|
private |
Definition at line 804 of file formula.cpp.
|
private |
Definition at line 805 of file formula.cpp.
|
private |
Definition at line 806 of file formula.cpp.