working on refactoring
This commit is contained in:
1 parent
9b71ee447a
commit
d5ef126264
12 files changed
+309
-219
No files matched your search
+10
-1
@@ -60,12 +60,17 @@ namespace FRG
|
||||
std::string triggerZonesJsonPath;
|
||||
std::string lightsJsonPath;
|
||||
Eigen::Vector3f playerPosition = Eigen::Vector3f::Zero();
|
||||
// Player shared by all locations of a campaign (see Location::createPlayer);
|
||||
// setup() creates a private one when this is null.
|
||||
std::shared_ptr<Character> player;
|
||||
};
|
||||
|
||||
class Location : public ISaveable
|
||||
{
|
||||
public:
|
||||
Location(Renderer& iRenderer, Inventory& iInventory);
|
||||
// Detaches the (shared, longer-lived) player from this location.
|
||||
~Location();
|
||||
|
||||
// ---- All serialisable runtime state ----
|
||||
LocationState state;
|
||||
@@ -74,9 +79,13 @@ namespace FRG
|
||||
|
||||
std::vector<InteractiveObject> interactiveObjects;
|
||||
|
||||
std::unique_ptr<Character> player;
|
||||
// Shared: the same player moves from location to location and outlives them.
|
||||
std::shared_ptr<Character> player;
|
||||
std::vector<std::unique_ptr<Character>> npcs;
|
||||
|
||||
// Builds the player character (models, animations, weapon, textures).
|
||||
static std::shared_ptr<Character> createPlayer(Renderer& renderer, AudioPlayerAsync* audioPlayer);
|
||||
|
||||
std::vector<PathFinder> navigationMaps;
|
||||
PathFinder* navigation = nullptr;
|
||||
|
||||
|
||||
Reference in new issue
Block a user