Interface IEventSettings
The IEventSettings is used to map IRewards between an IEventContents IMilestones and another IContent.
It is recommended that this data be globally accessible in all IContent to reduce the risk of save or IReward claiming issues. Using this global mapping across IContent allows for only one set of IContent and associated data to be loaded at a time.
Namespace: IdleKit.Gameplay
Assembly: cs.temp.dll.dll
Syntax
public interface IEventSettings : IEntity, IInjectable
Properties
CurrentPhase
Returns the currently active phase from the Phases list of the event which is currently active. Must return null if the event is not currently active.
Declaration
EventPhase CurrentPhase { get; }
Property Value
Type | Description |
---|---|
EventPhase |
CurrentPhaseElapsedMilliseconds
Returns the start timestamp for the currently active Beamable.Common.Content.EventPhase in the currently active event. Returns 0 if the event is inactive.
Declaration
long CurrentPhaseElapsedMilliseconds { get; }
Property Value
Type | Description |
---|---|
Int64 |
CurrentPhaseEndTime
Returns the end time of the current phase if one is currently active. If there is no active phase, returns the current game time.
Declaration
DateTime CurrentPhaseEndTime { get; }
Property Value
Type | Description |
---|---|
DateTime |
CurrentPhaseStartTime
Returns the start time of the current phase if one is currently active. If there is no active phase, returns the current game time.
Declaration
DateTime CurrentPhaseStartTime { get; }
Property Value
Type | Description |
---|---|
DateTime |
EventEndTime
Returns a calculated end Date Time value when all the phases of the event will end.
Declaration
DateTime EventEndTime { get; }
Property Value
Type | Description |
---|---|
DateTime |
EventSettingsData
Returns the IEventSettingsData associated with this IEventSettings.
Declaration
IEventSettingsData EventSettingsData { get; }
Property Value
Type | Description |
---|---|
IEventSettingsData |
EventSettingsSavedData
Returns the IMilestoneSavedData associated with this IEventSettings.
Declaration
IEventSettingsSavedData EventSettingsSavedData { get; }
Property Value
Type | Description |
---|---|
IEventSettingsSavedData |
IsActive
Returns whether the associated IEventContent is currently active.
Declaration
bool IsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
TimeRemainingInCurrentPhaseMilliseconds
Returns the time remaining in the currently active phase. Returns 0 if there is no Beamable.Common.Content.EventContent currently active. Returns 0 if the event is inactive.
Declaration
long TimeRemainingInCurrentPhaseMilliseconds { get; }
Property Value
Type | Description |
---|---|
Int64 |
TimeRemainingMilliseconds
Returns the time remaining in milliseconds. Returns 0 if IEventContent is not active.
Declaration
long TimeRemainingMilliseconds { get; }
Property Value
Type | Description |
---|---|
Int64 |
Methods
CanClaimRewards(String)
Returns true if criteria for claiming IEventContent rewards are met.
Declaration
bool CanClaimRewards(string claimInContentId)
Parameters
Type | Name | Description |
---|---|---|
String | claimInContentId | The current IContent id. |
Returns
Type | Description |
---|---|
Boolean |
CanCompleteMilestone(IMilestone)
Returns true if the
Declaration
bool CanCompleteMilestone(IMilestone milestone)
Parameters
Type | Name | Description |
---|---|---|
IMilestone | milestone | The IMilestone. |
Returns
Type | Description |
---|---|
Boolean | Return false if the |
Remarks
This method should only be called when the milestone
is loaded and in an
IEventContent.
ClaimRewards(String)
Claims any rewards that the player met the criteria for claiming.
Declaration
void ClaimRewards(string claimInContentId)
Parameters
Type | Name | Description |
---|---|---|
String | claimInContentId | The current IContent id. |
FinalizeEvent(Int64)
Used to try and end the event, if there isn't currently a phase of the event active. Should be called at the end of each event phase.
Declaration
void FinalizeEvent(long timestamp)
Parameters
Type | Name | Description |
---|---|---|
Int64 | timestamp | The timestamp in milliseconds that the IEventContent ended. |
ForceEndEvent(Int64)
Ends the associated IEventContent immediately, sets IsComplete to true,
and sets TimeCompletedTimestamp to timestamp
.
If the player earned any IMilestone related IReward it can be claimed in the IContent
with ClaimInContentId.
Declaration
void ForceEndEvent(long timestamp)
Parameters
Type | Name | Description |
---|---|---|
Int64 | timestamp | The timestamp in milliseconds that the IEventContent ended. |
GetMilestoneCompletionInfo(String)
Get the MilestoneCompletionInfo associated with the milestoneId
. Returns
null if the MilestoneCompletionInfo is not found.
Declaration
MilestoneCompletionInfo GetMilestoneCompletionInfo(string milestoneId)
Parameters
Type | Name | Description |
---|---|---|
String | milestoneId |
Returns
Type | Description |
---|---|
MilestoneCompletionInfo |
GetRewardIds()
Returns a list of IReward ids that the player met the criteria for claiming.
Declaration
string[] GetRewardIds()
Returns
Type | Description |
---|---|
String[] |
SetEventEndTime(Int64)
Sets the end time of the IEventContent. Does so by changing the duration of the Beamable.Common.Content.EventContents in the EventSettingsData. Setting an end time in the past will cause the event to end immediately.
Declaration
void SetEventEndTime(long timestamp)
Parameters
Type | Name | Description |
---|---|---|
Int64 | timestamp | The timestamp in milliseconds that the IEventContent will end. |
Remarks
If SetEventEndTime(Int64) is called while the event is active, it is recommended that the game is restarted to avoid UI issues.
SetMilestoneCompletionTime(IMilestone, Int64)
Completes a IMilestone at a specific time. Useful for forecasting future completion times.
Declaration
void SetMilestoneCompletionTime(IMilestone milestone, long timestampInMilliseconds)
Parameters
Type | Name | Description |
---|---|---|
IMilestone | milestone | The IMilestone to complete. |
Int64 | timestampInMilliseconds | The timestamp in milliseconds at which the IMilestone was or will be completed. |
Remarks
This method should only be called when the milestone
is loaded and in an
IEventContent.
StartEvent(Int64, Int64)
Starts the associated IEventContent. TimeStartedTimestamp.
Declaration
void StartEvent(long startTimestamp, long endTimestamp)
Parameters
Type | Name | Description |
---|---|---|
Int64 | startTimestamp | The timestamp in milliseconds that the IEventContent started. This should be the current timestamp and not a time in the future. |
Int64 | endTimestamp | The timestamp in milliseconds that the IEventContent will end. |