nw::kernel::FactionSystem

struct FactionSystem : public nw::kernel::Service

Public Functions

FactionSystem(MemoryResource *scope)
virtual void initialize(ServiceInitTime time) override

Initializes a service

Note

Every service will be called with as many values as exist in ServiceInitTime. it’s up to the service itself to filter/ignore what’s not relevant to them.

Vector<String> all() const

Gets all factions by name.

size_t count() const

Gets number of factions.

uint32_t faction_id(StringView name) const

Gets faction ID by name.

Reputation locate(uint32_t faction1, uint32_t faction2) const

Gets the reputation between 2 factions.

StringView name(uint32_t) const

Gets faction name by ID.

uint32_t reputation(uint32_t faction1, uint32_t faction2) const

Gets the reputation value between 2 factions.

virtual nlohmann::json stats() const override

Log service stats, if the service wants.

MemoryResource *allocator() const noexcept

Gets the memory allocator for the servce.

Public Static Attributes

static const std::type_index type_index = {typeid(FactionSystem)}