baba-is-auto
C++17 Baba Is You simulator
Loading...
Searching...
No Matches
Rule.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2026 Chris Ohk
2
3// I am making my contributions/submissions to this project solely in our
4// personal capacity and am not conveying any rights to any intellectual
5// property of any third parties.
6
7#ifndef BABA_IS_AUTO_RULE_HPP
8#define BABA_IS_AUTO_RULE_HPP
9
11
12#include <tuple>
13#include <vector>
14
15namespace baba_is_auto
16{
18{
19 ObjectType op = ObjectType::ON;
20 std::vector<ObjectType> targets;
21 bool negated = false;
22
23 bool operator==(const RuleCondition& rhs) const;
24};
25
33class Rule
34{
35 public:
41 Rule(Object obj1, Object obj2, Object obj3,
42 std::vector<RuleCondition> ruleConditions = {});
43
47 bool operator==(const Rule& rhs) const;
48
50 std::tuple<Object, Object, Object> objects;
51
53 std::vector<RuleCondition> conditions;
54};
55} // namespace baba_is_auto
56
57#endif
Object class.
Definition Object.hpp:47
Rule class.
Definition Rule.hpp:34
bool operator==(const Rule &rhs) const
std::vector< RuleCondition > conditions
Optional conditions restricting which subject instances match.
Definition Rule.hpp:53
std::tuple< Object, Object, Object > objects
The subject, operator, and predicate objects.
Definition Rule.hpp:50
Rule(Object obj1, Object obj2, Object obj3, std::vector< RuleCondition > ruleConditions={})
Definition IAgent.hpp:14
ObjectType
An enumerator for identifying the object.
Definition GameEnums.hpp:14
Definition Rule.hpp:18
ObjectType op
Definition Rule.hpp:19
bool negated
Definition Rule.hpp:21
bool operator==(const RuleCondition &rhs) const
std::vector< ObjectType > targets
Definition Rule.hpp:20