aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/map/Building.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-09-09 23:49:54 +0200
committer GitHub <noreply@github.com>2023-09-09 23:49:54 +0200
commit6278a35f4704574933464700026d8deb997da5c1 (patch)
treeeb36a9b030b263d825eb93638e64deb0dbd38a78 /src/openvic/map/Building.hpp
parentbec619fc8f554cb075fcef2428f3b6bdb5e88e82 (diff)
parent3d7fbd9b376811ca0ed226fa78bcc8b6279ba8dc (diff)
Merge pull request #14 from OpenVicProject/dataloading
Dataloading scaffolding + basic culture and pop history loading
Diffstat (limited to 'src/openvic/map/Building.hpp')
-rw-r--r--src/openvic/map/Building.hpp86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/openvic/map/Building.hpp b/src/openvic/map/Building.hpp
deleted file mode 100644
index c00932b..0000000
--- a/src/openvic/map/Building.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-#pragma once
-
-#include <vector>
-
-#include "../Date.hpp"
-#include "../Types.hpp"
-
-namespace OpenVic {
-
- struct BuildingManager;
- struct BuildingType;
-
- /* REQUIREMENTS:
- * MAP-11, MAP-72, MAP-73
- * MAP-12, MAP-75, MAP-76
- * MAP-13, MAP-78, MAP-79
- */
- struct Building : HasIdentifier {
- friend struct BuildingManager;
-
- using level_t = int8_t;
-
- enum class ExpansionState {
- CannotExpand,
- CanExpand,
- Preparing,
- Expanding
- };
-
- private:
- BuildingType const& type;
- level_t level = 0;
- ExpansionState expansion_state = ExpansionState::CannotExpand;
- Date start, end;
- float expansion_progress;
-
- Building(BuildingType const& new_type);
-
- bool _can_expand() const;
-
- public:
- Building(Building&&) = default;
-
- BuildingType const& get_type() const;
- level_t get_level() const;
- ExpansionState get_expansion_state() const;
- Date const& get_start_date() const;
- Date const& get_end_date() const;
- float get_expansion_progress() const;
-
- return_t expand();
- void update_state(Date const& today);
- void tick(Date const& today);
- };
-
- struct BuildingType : HasIdentifier {
- friend struct BuildingManager;
-
- private:
- const Building::level_t max_level;
- const Timespan build_time;
-
- BuildingType(const std::string_view new_identifier, Building::level_t new_max_level, Timespan new_build_time);
-
- public:
- BuildingType(BuildingType&&) = default;
-
- Building::level_t get_max_level() const;
- Timespan get_build_time() const;
- };
-
- struct Province;
-
- struct BuildingManager {
- private:
- IdentifierRegistry<BuildingType> building_types;
-
- public:
- BuildingManager();
-
- return_t add_building_type(const std::string_view identifier, Building::level_t max_level, Timespan build_time);
- void lock_building_types();
- BuildingType const* get_building_type_by_identifier(const std::string_view identifier) const;
- return_t generate_province_buildings(Province& province) const;
- };
-}