![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Evaluates a ConditionPreset against a RuntimeEnvironment. More...
#include <ConditionPresetEvaluator.h>
Static Public Member Functions | |
| static bool | Evaluate (const ConditionPreset &preset, RuntimeEnvironment &env, std::string &outErrorMsg) |
| Evaluates a single ConditionPreset and returns the boolean result. | |
| static bool | EvaluateConditionChain (const std::vector< NodeConditionRef > &conditions, const ConditionPresetRegistry ®istry, RuntimeEnvironment &env, std::string &outErrorMsg) |
| Evaluates a chain of conditions combined with logical operators (AND/OR). | |
Static Private Member Functions | |
| static bool | ResolveOperand (const Operand &operand, RuntimeEnvironment &env, std::string &outErrorMsg, float &outValue) |
| Resolves an Operand to its runtime float value. | |
| static bool | EvaluateOperator (float left, ComparisonOp op, float right, std::string &outErrorMsg) |
| Applies a ComparisonOp to two float values. | |
Evaluates a ConditionPreset against a RuntimeEnvironment.
Typical usage:
For multiple conditions with logical operators:
Definition at line 69 of file ConditionPresetEvaluator.h.
|
static |
Evaluates a single ConditionPreset and returns the boolean result.
| preset | The condition preset to evaluate. |
| env | Runtime environment providing variable and pin values. |
| outErrorMsg | Receives a human-readable error description on failure. Empty on success. |
Definition at line 22 of file ConditionPresetEvaluator.cpp.
References EvaluateOperator(), GetComponentTypeID_Static(), and ResolveOperand().
Referenced by EvaluateConditionChain(), Olympe::Examples::Example1_SimpleHealthCheck(), Olympe::Examples::Example2_ConstModeOperand(), and Olympe::Examples::Example6_ErrorHandling().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Evaluates a chain of conditions combined with logical operators (AND/OR).
Implements short-circuit evaluation:
The first condition's LogicalOp is ignored (treated as Start).
| conditions | Vector of NodeConditionRef objects referencing presets. Each preset ID is resolved via the provided registry. |
| registry | Registry containing the ConditionPreset objects. |
| env | Runtime environment providing variable and pin values. |
| outErrorMsg | Receives a human-readable error description on failure. Empty on success. |
Definition at line 42 of file ConditionPresetEvaluator.cpp.
References Olympe::And, Evaluate(), GetComponentTypeID_Static(), Olympe::Or, and Olympe::Start.
Referenced by Olympe::VSGraphExecutor::HandleBranch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Applies a ComparisonOp to two float values.
| left | Left-hand side value. |
| op | Operator to apply. |
| right | Right-hand side value. |
| outErrorMsg | Receives an error description for unknown operators. |
Definition at line 202 of file ConditionPresetEvaluator.cpp.
References Olympe::Equal, GetComponentTypeID_Static(), Olympe::Greater, Olympe::GreaterEqual, Olympe::Less, Olympe::LessEqual, and Olympe::NotEqual.
Referenced by Evaluate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Resolves an Operand to its runtime float value.
| operand | Operand to resolve. |
| env | RuntimeEnvironment used for Variable / Pin lookup. |
| outErrorMsg | Receives an error description when resolution fails. |
| outValue | Receives the resolved float value on success. |
Definition at line 157 of file ConditionPresetEvaluator.cpp.
References Olympe::Const, GetComponentTypeID_Static(), Olympe::Pin, and Olympe::Variable.
Referenced by Evaluate().
Here is the call graph for this function:
Here is the caller graph for this function: