@@ -11,6 +11,7 @@ namespace OpenVic {
1111 struct ProvinceInstance ;
1212 struct State ;
1313 struct Pop ;
14+ struct DefinitionManager ;
1415
1516 struct Context {
1617 std::variant<
@@ -19,19 +20,29 @@ namespace OpenVic {
1920 State const *,
2021 Pop const *> ptr;
2122
23+ DefinitionManager const & definition_manager;
24+
2225 Context const * this_scope = nullptr ;
2326 Context const * from_scope = nullptr ;
2427
25- Context (CountryInstance const * p) : ptr(p), this_scope(this ) {}
26- Context (ProvinceInstance const * p) : ptr(p), this_scope(this ) {}
27- Context (State const * p) : ptr(p), this_scope(this ) {}
28- Context (Pop const * p) : ptr(p), this_scope(this ) {}
28+ Context (CountryInstance const * p, DefinitionManager const & dm)
29+ : ptr(p), definition_manager(dm), this_scope(this ) {}
30+ Context (ProvinceInstance const * p, DefinitionManager const & dm)
31+ : ptr(p), definition_manager(dm), this_scope(this ) {}
32+ Context (State const * p, DefinitionManager const & dm)
33+ : ptr(p), definition_manager(dm), this_scope(this ) {}
34+ Context (Pop const * p, DefinitionManager const & dm)
35+ : ptr(p), definition_manager(dm), this_scope(this ) {}
2936
3037 Context (
3138 auto * p,
39+ DefinitionManager const & dm,
3240 Context const * this_ctx,
3341 Context const * from_ctx
34- ) : ptr(p), this_scope(this_ctx), from_scope(from_ctx) {}
42+ ) : ptr(p),
43+ definition_manager (dm),
44+ this_scope(this_ctx),
45+ from_scope(from_ctx) {}
3546
3647 scope_type_t get_scope_type () const ;
3748
@@ -44,7 +55,7 @@ namespace OpenVic {
4455 std::optional<Context> get_redirect_context (std::string_view condition_id, scope_type_t target) const ;
4556
4657 Context make_child (auto * p) const {
47- return Context (p, this ->this_scope , this );
58+ return Context (p, definition_manager, this ->this_scope , this );
4859 }
4960 };
5061}
0 commit comments