VIPRA Documentation
Loading...
Searching...
No Matches
subcondition_attribute.hpp
1#pragma once
2
3#include "vipra/types/idx.hpp"
4
5#include "vipra/vipra_behaviors/attributes/attributes.hpp"
6#include "vipra/vipra_behaviors/conditions/sub_condition.hpp"
7#include "vipra/vipra_behaviors/util/class_types.hpp"
8
9namespace VIPRA::Behaviors {
14class SubConditionAttribute {
15 NON_DEFAULT_CONSTRUCTIBLE(SubConditionAttribute)
16 COPYABLE(SubConditionAttribute)
17 MOVEABLE(SubConditionAttribute)
18
19 public:
20 explicit SubConditionAttribute(Attribute type, CAttributeValue val, bool negative)
21 : _type(type), _value(val), _not(negative)
22 {
23 }
24
25 void operator()(Simpack pack, const VIPRA::idxVec& peds,
26 std::vector<Target> const& targets, std::vector<bool>& met,
27 std::vector<bool> const& /*unused*/, BoolOp /*unused*/) const;
28
29 [[nodiscard]] auto individual(Simpack pack, VIPRA::idx self,
30 Target target) const -> bool;
31
32 private:
33 Attribute _type;
34 CAttributeValue _value;
35 bool _not;
36
37 static constexpr VIPRA::f_pnt TOWARDS_THRESHOLD = 0.5F;
38
39 [[nodiscard]] inline auto towards_compare(CAttributeValue& attr, Simpack pack,
40 VIPRA::idx self) const -> bool;
41
42 [[nodiscard]] inline auto towards_location_compare(CAttributeValue& attr, Simpack pack,
43 VIPRA::idx self) const -> bool;
44
45 [[nodiscard]] inline auto towards_attribute_compare(
46 CAttributeValue& /*unused*/, auto /*unused*/, VIPRA::idx /*unused*/) const -> bool;
47};
48} // namespace VIPRA::Behaviors
Holds an immutable attribute value and its type.
Definition attributes.hpp:57
Holds references to commonly used parameters for simpler passing.
Definition sim_pack.hpp:23
Holds information about what to target.
Definition target.hpp:18