Skip to main content

SchedulerConfig Class

Fluent configuration for a single spawn rule. More...

Declaration

class helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig { ... }

Public Constructors Index

SchedulerConfig (helios::engine::runtime::spawn::types::SpawnProfileId profileId, helios::engine::runtime::spawn::types::SpawnRuleId ruleId)

Constructs a SchedulerConfig. More...

Public Member Functions Index

SchedulerConfig &timerCondition (const float intervalSeconds)

Sets a timer-based spawn condition. More...

SchedulerConfig &timerWithAvailabilityCondition (const float intervalSeconds)

Sets a combined condition: timer + pool availability. More...

SchedulerConfig &condition (std::unique_ptr< const helios::engine::runtime::spawn::policy::SpawnCondition > customCondition)

Sets a custom spawn condition. More...

SchedulerConfig &fixedAmount (const size_t count)

Sets a fixed spawn amount. More...

SchedulerConfig &amount (std::unique_ptr< const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider > customProvider)

Sets a custom amount provider. More...

helios::engine::runtime::spawn::types::SpawnProfileIdprofileId () const noexcept

Returns the profile ID for this rule. More...

std::unique_ptr< helios::engine::runtime::spawn::policy::SpawnRule >build ()

Builds and returns the configured SpawnRule. More...

Private Member Attributes Index

helios::engine::runtime::spawn::types::SpawnProfileIdprofileId_

Profile this rule is bound to. More...

helios::engine::runtime::spawn::types::SpawnRuleIdruleId_

Unique identifier for the rule. More...

std::unique_ptr< const helios::engine::runtime::spawn::policy::SpawnCondition >condition_

Condition determining when to spawn. More...

std::unique_ptr< const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider >amountProvider_

Provider determining how many to spawn. More...

Description

Fluent configuration for a single spawn rule.

Provides convenience methods for assembling a SpawnRule from condition and amount providers.

Definition at line 28 of file SchedulerConfig.ixx.

Public Constructors

SchedulerConfig()

helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::SchedulerConfig (helios::engine::runtime::spawn::types::SpawnProfileId profileId, helios::engine::runtime::spawn::types::SpawnRuleId ruleId)
inline

Constructs a SchedulerConfig.

Parameters
profileId

The spawn profile this rule targets.

ruleId

Unique identifier for this rule.

Definition at line 58 of file SchedulerConfig.ixx.

61 ) : profileId_(profileId), ruleId_(ruleId), condition_(nullptr), amountProvider_(nullptr) {}

Reference profileId.

Referenced by amount, condition, fixedAmount, timerCondition and timerWithAvailabilityCondition.

Public Member Functions

amount()

SchedulerConfig & helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::amount (std::unique_ptr< const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider > customProvider)
inline

Sets a custom amount provider.

Parameters
customProvider

Ownership is transferred.

Returns

Reference to this config for chaining.

Definition at line 128 of file SchedulerConfig.ixx.

129 std::unique_ptr<const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider> customProvider
130 ) {
131 amountProvider_ = std::move(customProvider);
132 return *this;
133 }

Reference SchedulerConfig.

build()

std::unique_ptr< helios::engine::runtime::spawn::policy::SpawnRule > helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::build ()
inline nodiscard

Builds and returns the configured SpawnRule.

Returns

The assembled SpawnRule. Ownership is transferred to the caller.

Definition at line 149 of file SchedulerConfig.ixx.

149 [[nodiscard]] std::unique_ptr<helios::engine::runtime::spawn::policy::SpawnRule> build() {
150 return std::make_unique<helios::engine::runtime::spawn::policy::SpawnRule>(
151 std::move(condition_),
152 std::move(amountProvider_),
153 ruleId_
154 );
155 }

condition()

SchedulerConfig & helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::condition (std::unique_ptr< const helios::engine::runtime::spawn::policy::SpawnCondition > customCondition)
inline

Sets a custom spawn condition.

Parameters
customCondition

Ownership is transferred.

Returns

Reference to this config for chaining.

Definition at line 101 of file SchedulerConfig.ixx.

102 std::unique_ptr<const helios::engine::runtime::spawn::policy::SpawnCondition> customCondition
103 ) {
104 condition_ = std::move(customCondition);
105 return *this;
106 }

Reference SchedulerConfig.

fixedAmount()

SchedulerConfig & helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::fixedAmount (const size_t count)
inline

Sets a fixed spawn amount.

Parameters
count

Number of entities to spawn per trigger.

Returns

Reference to this config for chaining.

Definition at line 115 of file SchedulerConfig.ixx.

115 SchedulerConfig& fixedAmount(const size_t count) {
116 amountProvider_ = std::make_unique<
118 return *this;
119 }

Reference SchedulerConfig.

profileId()

helios::engine::runtime::spawn::types::SpawnProfileId helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::profileId ()
inline nodiscard noexcept

Returns the profile ID for this rule.

Returns

The spawn profile ID.

Definition at line 140 of file SchedulerConfig.ixx.

141 return profileId_;
142 }

Referenced by SchedulerConfig.

timerCondition()

SchedulerConfig & helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::timerCondition (const float intervalSeconds)
inline

Sets a timer-based spawn condition.

Parameters
intervalSeconds

Seconds between spawn evaluations.

Returns

Reference to this config for chaining.

Definition at line 70 of file SchedulerConfig.ixx.

70 SchedulerConfig& timerCondition(const float intervalSeconds) {
71 condition_ = std::make_unique<
73 intervalSeconds
74 );
75 return *this;
76 }

Reference SchedulerConfig.

timerWithAvailabilityCondition()

SchedulerConfig & helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::timerWithAvailabilityCondition (const float intervalSeconds)
inline

Sets a combined condition: timer + pool availability.

Parameters
intervalSeconds

Seconds between spawn evaluations.

Returns

Reference to this config for chaining.

Definition at line 85 of file SchedulerConfig.ixx.

85 SchedulerConfig& timerWithAvailabilityCondition(const float intervalSeconds) {
86 condition_ = std::make_unique<
88 std::make_unique<helios::engine::runtime::spawn::policy::conditions::TimerSpawnCondition>(intervalSeconds),
89 std::make_unique<helios::engine::runtime::spawn::policy::conditions::RequestedAmountIsAvailableCondition>()
90 );
91 return *this;
92 }

Reference SchedulerConfig.

Private Member Attributes

amountProvider_

std::unique_ptr<const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider> helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::amountProvider_

Provider determining how many to spawn.

Definition at line 48 of file SchedulerConfig.ixx.

48 std::unique_ptr<const helios::engine::runtime::spawn::policy::amount::SpawnAmountProvider> amountProvider_;

condition_

std::unique_ptr<const helios::engine::runtime::spawn::policy::SpawnCondition> helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::condition_

Condition determining when to spawn.

Definition at line 43 of file SchedulerConfig.ixx.

43 std::unique_ptr<const helios::engine::runtime::spawn::policy::SpawnCondition> condition_;

profileId_

helios::engine::runtime::spawn::types::SpawnProfileId helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::profileId_

Profile this rule is bound to.

Definition at line 33 of file SchedulerConfig.ixx.

ruleId_

helios::engine::runtime::spawn::types::SpawnRuleId helios::engine::builder::spawnSystem::builders::configs::SchedulerConfig::ruleId_

Unique identifier for the rule.

Definition at line 38 of file SchedulerConfig.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.