This commit is contained in:
Aria 2025-03-21 22:23:30 +11:00
commit 9c94d113d3
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
10260 changed files with 1237388 additions and 0 deletions

View file

@ -0,0 +1,72 @@
#ifndef STAR_PLAYER_FACTORY_HPP
#define STAR_PLAYER_FACTORY_HPP
#include "StarItemDescriptor.hpp"
#include "StarHumanoid.hpp"
#include "StarEntitySplash.hpp"
namespace Star {
STAR_CLASS(Player);
STAR_STRUCT(PlayerConfig);
STAR_CLASS(PlayerFactory);
STAR_EXCEPTION(PlayerException, StarException);
// The player has a large number of shared config states, so this is a shared
// config object to hold them.
struct PlayerConfig {
PlayerConfig(JsonObject const& cfg);
HumanoidIdentity defaultIdentity;
Humanoid::HumanoidTiming humanoidTiming;
List<ItemDescriptor> defaultItems;
List<ItemDescriptor> defaultBlueprints;
RectF metaBoundBox;
Json movementParameters;
Json zeroGMovementParameters;
Json statusControllerSettings;
float footstepTiming;
Vec2F footstepSensor;
Vec2F underwaterSensor;
float underwaterMinWaterLevel;
String effectsAnimator;
float teleportInTime;
float teleportOutTime;
float deployInTime;
float deployOutTime;
String bodyMaterialKind;
EntitySplashConfig splashConfig;
Json companionsConfig;
Json deploymentConfig;
StringMap<String> genericScriptContexts;
};
class PlayerFactory {
public:
PlayerFactory();
PlayerPtr create() const;
PlayerPtr diskLoadPlayer(Json const& diskStore) const;
PlayerPtr netLoadPlayer(ByteArray const& netStore) const;
private:
PlayerConfigPtr m_config;
};
}
#endif