Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/openvic-simulation/country/CountryInstance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ namespace OpenVic {

// The total/resultant modifier affecting this country, including owned province contributions.
ModifierSum PROPERTY(modifier_sum);
memory::vector<ModifierInstance> PROPERTY(event_modifiers);
memory::vector<ModifierInstance> SPAN_PROPERTY(event_modifiers);

/* Production */
OV_STATE_PROPERTY(fixed_point_t, industrial_power);
memory::vector<std::pair<State const*, fixed_point_t>> PROPERTY(industrial_power_from_states);
memory::vector<std::pair<CountryInstance const*, fixed_point_t>> PROPERTY(industrial_power_from_investments);
memory::vector<std::pair<State const*, fixed_point_t>> SPAN_PROPERTY(industrial_power_from_states);
memory::vector<std::pair<CountryInstance const*, fixed_point_t>> SPAN_PROPERTY(industrial_power_from_investments);
size_t PROPERTY(industrial_rank, 0);
fixed_point_map_t<CountryInstance const*> PROPERTY(foreign_investments);
OV_IFLATMAP_PROPERTY(BuildingType, technology_unlock_level_t, building_type_unlock_levels);
Expand Down Expand Up @@ -390,7 +390,7 @@ namespace OpenVic {
OV_IFLATMAP_PROPERTY(ShipType, technology_unlock_level_t, ship_type_unlock_levels);
technology_unlock_level_t PROPERTY(gas_attack_unlock_level, 0);
technology_unlock_level_t PROPERTY(gas_defence_unlock_level, 0);
memory::vector<technology_unlock_level_t> PROPERTY(unit_variant_unlock_levels);
memory::vector<technology_unlock_level_t> SPAN_PROPERTY(unit_variant_unlock_levels);

public:
//pointers instead of references to allow construction via std::tuple
Expand Down
4 changes: 2 additions & 2 deletions src/openvic-simulation/dataloader/ModManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace OpenVic {
ModManager const& mod_manager;
const memory::string PROPERTY(dataloader_root_path);
const std::optional<memory::string> PROPERTY(user_dir);
const memory::vector<memory::string> PROPERTY(replace_paths);
const memory::vector<memory::string> PROPERTY(dependencies);
const memory::vector<memory::string> SPAN_PROPERTY(replace_paths);
const memory::vector<memory::string> SPAN_PROPERTY(dependencies);

public:
Mod(
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/economy/BuildingType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace OpenVic {
building_level_t PROPERTY(fort_level); // fort bonus step-per-level

naval_capacity_t PROPERTY(naval_capacity);
memory::vector<fixed_point_t> PROPERTY(colonial_points);
memory::vector<fixed_point_t> SPAN_PROPERTY(colonial_points);
bool PROPERTY_CUSTOM_PREFIX(in_province, is); // province
bool PROPERTY(one_per_state);
fixed_point_t PROPERTY(colonial_range);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/economy/GoodDefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace OpenVic {
friend struct GoodDefinitionManager;

private:
memory::vector<GoodDefinition const*> PROPERTY(good_definitions);
memory::vector<GoodDefinition const*> SPAN_PROPERTY(good_definitions);
public:
GoodCategory(std::string_view new_identifier);
GoodCategory(GoodCategory&&) = default;
Expand Down
4 changes: 2 additions & 2 deletions src/openvic-simulation/economy/production/ProductionType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ namespace OpenVic {
private:
GameRulesManager const& game_rules_manager;
const std::optional<Job> PROPERTY(owner);
memory::vector<Job> PROPERTY(jobs);
memory::vector<Job> SPAN_PROPERTY(jobs);

fixed_point_map_t<GoodDefinition const*> PROPERTY(input_goods);
memory::vector<bonus_t> PROPERTY(bonuses);
memory::vector<bonus_t> SPAN_PROPERTY(bonuses);

fixed_point_map_t<GoodDefinition const*> PROPERTY(maintenance_requirements);
const bool PROPERTY_CUSTOM_PREFIX(coastal, is);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace OpenVic {
fixed_point_t PROPERTY(output_quantity_yesterday);
fixed_point_t PROPERTY(unsold_quantity_yesterday);
fixed_point_t PROPERTY_RW(size_multiplier);
memory::vector<Employee> PROPERTY(employees);
memory::vector<Employee> SPAN_PROPERTY(employees);
pop_size_t PROPERTY(max_employee_count_cache, 0);
pop_size_t PROPERTY(total_employees_count_cache, 0);
pop_size_t PROPERTY(total_paid_employees_count_cache, 0);
Expand Down
6 changes: 3 additions & 3 deletions src/openvic-simulation/history/DiplomaticHistory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ namespace OpenVic {
/* Edge cases where this is empty/undef for some reason,
* probably need to just generate war names like usual for that. */
memory::string PROPERTY(war_name);
memory::vector<war_participant_t> PROPERTY(attackers);
memory::vector<war_participant_t> PROPERTY(defenders);
memory::vector<added_wargoal_t> PROPERTY(wargoals);
memory::vector<war_participant_t> SPAN_PROPERTY(attackers);
memory::vector<war_participant_t> SPAN_PROPERTY(defenders);
memory::vector<added_wargoal_t> SPAN_PROPERTY(wargoals);
};

struct AllianceHistory {
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/history/ProvinceHistory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace OpenVic {
ordered_map<BuildingType const*, building_level_t> PROPERTY(province_buildings);
ordered_map<BuildingType const*, building_level_t> PROPERTY(state_buildings);
fixed_point_map_t<Ideology const*> PROPERTY(party_loyalties);
memory::vector<PopBase> PROPERTY(pops);
memory::vector<PopBase> SPAN_PROPERTY(pops);

bool _load_province_pop_history(
DefinitionManager const& definition_manager, ast::NodeCPtr root, bool *non_integer_size
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/interface/GFXObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace OpenVic::GFX {
std::optional<Animation> PROPERTY(idle_animation);
std::optional<Animation> PROPERTY(move_animation);
std::optional<Animation> PROPERTY(attack_animation);
memory::vector<Attachment> PROPERTY(attachments);
memory::vector<Attachment> SPAN_PROPERTY(attachments);

bool _set_animation(std::string_view name, std::string_view file, fixed_point_t scroll_time);

Expand Down
6 changes: 3 additions & 3 deletions src/openvic-simulation/map/MapDefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace OpenVic {
friend struct MapDefinition;

private:
memory::vector<ivec2_t> PROPERTY(points);
memory::vector<ivec2_t> SPAN_PROPERTY(points);

public:
const uint8_t size;
Expand Down Expand Up @@ -59,11 +59,11 @@ namespace OpenVic {
ProvinceSet water_provinces;
TerrainTypeManager PROPERTY_REF(terrain_type_manager);

memory::vector<river_t> PROPERTY(rivers); // TODO: calculate provinces affected by crossing
memory::vector<river_t> SPAN_PROPERTY(rivers); // TODO: calculate provinces affected by crossing
void _trace_river(BMP& rivers_bmp, ivec2_t start, river_t& river);

ivec2_t PROPERTY(dims, { 0, 0 });
memory::vector<shape_pixel_t> PROPERTY(province_shape_image);
memory::vector<shape_pixel_t> SPAN_PROPERTY(province_shape_image);
colour_index_map_t colour_index_map;

ProvinceDefinition::index_t PROPERTY(max_provinces);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/map/ProvinceDefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace OpenVic {
/* Terrain type calculated from terrain image */
TerrainType const* PROPERTY(default_terrain_type, nullptr);

memory::vector<adjacency_t> PROPERTY(adjacencies);
memory::vector<adjacency_t> SPAN_PROPERTY(adjacencies);
/* Calculated mean pixel position. */
fvec2_t PROPERTY(centre);
province_positions_t positions {};
Expand Down
4 changes: 2 additions & 2 deletions src/openvic-simulation/map/ProvinceInstance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ namespace OpenVic {

// The total/resultant modifier of local effects on this province (global effects come from the province's owner)
ModifierSum PROPERTY(modifier_sum);
memory::vector<ModifierInstance> PROPERTY(event_modifiers);
memory::vector<ModifierInstance> SPAN_PROPERTY(event_modifiers);

bool PROPERTY(slave, false);
// Used for "minorities = yes/no" condition
bool PROPERTY(has_unaccepted_pops, false);
bool PROPERTY_RW(connected_to_capital, false);
bool PROPERTY_RW(is_overseas, false);
bool PROPERTY(has_empty_adjacent_province, false);
memory::vector<ProvinceInstance const*> PROPERTY(adjacent_nonempty_land_provinces);
memory::vector<ProvinceInstance const*> SPAN_PROPERTY(adjacent_nonempty_land_provinces);
Crime const* PROPERTY_RW(crime, nullptr);
ResourceGatheringOperation PROPERTY(rgo);
IdentifierRegistry<BuildingInstance> IDENTIFIER_REGISTRY(building, false);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/map/Region.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace OpenVic {

struct ProvinceSet {
private:
memory::vector<ProvinceDefinition const*> PROPERTY(provinces);
memory::vector<ProvinceDefinition const*> SPAN_PROPERTY(provinces);
bool locked = false;

public:
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/map/State.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace OpenVic {
/* Contains all current states.*/
struct StateManager {
private:
memory::vector<StateSet> PROPERTY(state_sets);
memory::vector<StateSet> SPAN_PROPERTY(state_sets);

bool add_state_set(
MapInstance& map_instance, Region const& region,
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/map/TerrainType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace OpenVic {
using index_t = uint8_t;

private:
memory::vector<index_t> PROPERTY(terrain_indices);
memory::vector<index_t> SPAN_PROPERTY(terrain_indices);

public:
TerrainType const& type;
Expand Down
8 changes: 4 additions & 4 deletions src/openvic-simulation/military/Deployment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace OpenVic {
private:
memory::string PROPERTY(name);
ProvinceDefinition const* PROPERTY(location);
memory::vector<_Unit> PROPERTY(units);
memory::vector<_Unit> SPAN_PROPERTY(units);
std::optional<size_t> PROPERTY(leader_index);

public:
Expand All @@ -78,9 +78,9 @@ namespace OpenVic {

struct Deployment : HasIdentifier {
private:
memory::vector<ArmyDeployment> PROPERTY(armies);
memory::vector<NavyDeployment> PROPERTY(navies);
memory::vector<LeaderBase> PROPERTY(leaders);
memory::vector<ArmyDeployment> SPAN_PROPERTY(armies);
memory::vector<NavyDeployment> SPAN_PROPERTY(navies);
memory::vector<LeaderBase> SPAN_PROPERTY(leaders);

public:
Deployment(
Expand Down
4 changes: 2 additions & 2 deletions src/openvic-simulation/military/LeaderTrait.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace OpenVic {
struct LeaderTraitManager {
private:
IdentifierRegistry<LeaderTrait> IDENTIFIER_REGISTRY(leader_trait);
memory::vector<LeaderTrait const*> PROPERTY(personality_traits);
memory::vector<LeaderTrait const*> PROPERTY(background_traits);
memory::vector<LeaderTrait const*> SPAN_PROPERTY(personality_traits);
memory::vector<LeaderTrait const*> SPAN_PROPERTY(background_traits);

// As well as their background and personality traits, leaders get this modifier scaled by their prestige
Modifier PROPERTY(leader_prestige_modifier);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/military/Wargoal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace OpenVic {
struct WargoalTypeManager {
private:
IdentifierRegistry<WargoalType> IDENTIFIER_REGISTRY(wargoal_type);
memory::vector<WargoalType const*> PROPERTY(peace_priorities);
memory::vector<WargoalType const*> SPAN_PROPERTY(peace_priorities);

public:
bool add_wargoal_type(
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/misc/Event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace OpenVic {
ConditionalWeightTime PROPERTY(mean_time_to_happen);
EffectScript PROPERTY(immediate);

memory::vector<EventOption> PROPERTY(options);
memory::vector<EventOption> SPAN_PROPERTY(options);

bool parse_scripts(DefinitionManager const& definition_manager);

Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/modifier/ModifierSum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace OpenVic {
// Targets to be excluded from all modifiers added to the sum, combined with any explicit exclusions.
ModifierEffect::target_t PROPERTY_RW(this_excluded_targets, ModifierEffect::target_t::NO_TARGETS);

memory::vector<modifier_entry_t> PROPERTY(modifiers);
memory::vector<modifier_entry_t> SPAN_PROPERTY(modifiers);
ModifierValue PROPERTY(value_sum);

public:
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/politics/BaseIssue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OpenVic {
friend struct IssueManager;

private:
memory::vector<BaseIssue const*> PROPERTY(issues);
memory::vector<BaseIssue const*> SPAN_PROPERTY(issues);

protected:
BaseIssueGroup(std::string_view new_identifier): HasIdentifier { new_identifier } {}
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/politics/Government.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace OpenVic {

struct GovernmentType : HasIndex<GovernmentType, government_type_index_t>, HasIdentifier {
private:
memory::vector<Ideology const*> PROPERTY(ideologies);
memory::vector<Ideology const*> SPAN_PROPERTY(ideologies);
const bool PROPERTY_CUSTOM_PREFIX(elections, holds);
const bool PROPERTY_CUSTOM_PREFIX(appoint_ruling_party, can);
memory::string PROPERTY_CUSTOM_NAME(flag_type_identifier, get_flag_type);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/politics/Reform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace OpenVic {
private:
bool PROPERTY(is_uncivilised); // whether this group is available to non-westernised countries
// in vanilla education, military and economic reforms are hardcoded to true and the rest to false
memory::vector<ReformGroup const*> PROPERTY(reform_groups);
memory::vector<ReformGroup const*> SPAN_PROPERTY(reform_groups);

public:
ReformType(std::string_view new_identifier, bool new_is_uncivilised);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/population/PopType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace OpenVic {
friend struct PopManager;

private:
memory::vector<PopType const*> PROPERTY(pop_types);
memory::vector<PopType const*> SPAN_PROPERTY(pop_types);

public:
Strata(std::string_view new_identifier, index_t new_index);
Expand Down
4 changes: 2 additions & 2 deletions src/openvic-simulation/research/Technology.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace OpenVic {
friend struct TechnologyManager;

private:
memory::vector<TechnologyArea const*> PROPERTY(technology_areas);
memory::vector<TechnologyArea const*> SPAN_PROPERTY(technology_areas);

public:
TechnologyFolder(std::string_view new_identifier, index_t new_index);
Expand All @@ -35,7 +35,7 @@ namespace OpenVic {
friend struct TechnologyManager;

private:
memory::vector<Technology const*> PROPERTY(technologies);
memory::vector<Technology const*> SPAN_PROPERTY(technologies);
size_t PROPERTY(tech_count, 0);

public:
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/scripts/ConditionalWeight.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace OpenVic {

private:
fixed_point_t PROPERTY(base, 0);
memory::vector<condition_weight_item_t> PROPERTY(condition_weight_items);
memory::vector<condition_weight_item_t> SPAN_PROPERTY(condition_weight_items);
scope_type_t PROPERTY(initial_scope);
scope_type_t PROPERTY(this_scope);
scope_type_t PROPERTY(from_scope);
Expand Down
2 changes: 1 addition & 1 deletion src/openvic-simulation/utility/Getters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public: \
NAME; \
\
public: \
[[nodiscard]] constexpr auto get_##NAME() const -> OpenVic::utility::forwardable_span<const decltype(NAME)::value_type> { \
[[nodiscard]] constexpr OpenVic::utility::forwardable_span<std::add_const_t<typename decltype(NAME)::value_type>> get_##NAME() const { \
return NAME; \
} \
ACCESS: