Class DynamicCollectCurrenciesWithTagsGoal
A IGoal that is complete when the player collects a dynamically calculated number of units of one or more ICurrency. This allows designers to create Goals that require the player to idle for an approximate period of time.
The target amount is calculated based on the sum of the payout-per-millisecond of each currently automated IGeneratorEntity multiplied by a number of seconds specified via Amount. For example, if the player had two automated generators each outputting a payout-per-second of 5 and 7,200 as the number of seconds (2 hours) then the IGoal would require the player to collect 36,000,000 units of the specified ICurrency.
Note: Because it is likely that the player will automated more IGeneratorEntitys or hit more IGeneratorUnitTargetDatas while the IGoal is active, it's likely the player will complete the IGoal before the exact number of seconds specified via Amount have elapsed.
The target ICurrencys are specified via one or more Tag Ids via TargetTagIds. At runtime these Tag Ids are resolved into one or more ICurrency. The TargetAllTags flag is used to specify whether a target ICurrency needs to contain all, or just one of the specified Tag Ids.
Each time the player collects units of the target ICurrency the IGoal is progressed by the number of collected units.
Only units of ICurrency collected after the IGoal becomes active count towards the progress of the IGoal. The target amount of the IGoal will not vary after it becomes active (ie. IGeneratorEntity automated after the IGoal activation will have no effect on the target).
Inheritance
Inherited Members
Namespace: IdleKit.Gameplay
Assembly: cs.temp.dll.dll
Syntax
public class DynamicCollectCurrenciesWithTagsGoal : DynamicCollectGoal<DynamicCollectCurrenciesWithTagsGoalData>, IDynamicGoal, IGoal, IActivatable, IEntity, IInjectable
Constructors
DynamicCollectCurrenciesWithTagsGoal(String)
Declaration
public DynamicCollectCurrenciesWithTagsGoal(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id |
Fields
_validCurrencies
Stored the ICurrency that contains the ITagData matching the TagConsumerData
Declaration
protected HashSet<ICurrency> _validCurrencies
Field Value
Type | Description |
---|---|
HashSet<ICurrency> |
Properties
TargetAllTags
Declaration
public virtual bool TargetAllTags { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Cleanup(IEntityLoaderService)
Declaration
public override void Cleanup(IEntityLoaderService entityLoaderService)
Parameters
Type | Name | Description |
---|---|---|
IEntityLoaderService | entityLoaderService |
Overrides
FilterEligibleCurrencies()
Declaration
protected virtual void FilterEligibleCurrencies()
GenerateDynamicTargetProgression()
Declaration
public override double GenerateDynamicTargetProgression()
Returns
Type | Description |
---|---|
Double |
Overrides
IsEligible(ICurrency)
Declaration
protected override bool IsEligible(ICurrency currency)
Parameters
Type | Name | Description |
---|---|---|
ICurrency | currency |
Returns
Type | Description |
---|---|
Boolean |