Class BasePhase<TTeamSettings>
public abstract class BasePhase<TTeamSettings> : ILayoutPhase, IEventListener<PlayerExitedZone>, IEventListener<PlayerTeamChanged>, IEventListener<PlayerJoined> where TTeamSettings : PhaseTeamSettings
Type Parameters
TTeamSettings
- Inheritance
-
BasePhase<TTeamSettings>
- Implements
- Derived
- Inherited Members
Constructors
BasePhase(IServiceProvider, IConfiguration)
protected BasePhase(IServiceProvider serviceProvider, IConfiguration config)
Parameters
serviceProviderIServiceProviderconfigIConfiguration
Fields
Layout
protected readonly Layout Layout
Field Value
TeamManager
protected readonly ITeamManager<Team> TeamManager
Field Value
Properties
Configuration
The configuration section used to create this phase.
public IConfiguration Configuration { get; }
Property Value
Duration
[UsedImplicitly]
public TimeSpan Duration { get; set; }
Property Value
Invincible
If all players can't take damage. Overrides Invincible if true.
[UsedImplicitly]
public bool Invincible { get; set; }
Property Value
IsActive
If this phase is currently activated.
public bool IsActive { get; }
Property Value
Logger
protected ILogger Logger { get; }
Property Value
Name
Display name of the phase on the popup toast for all teams.
[UsedImplicitly]
public TranslationList? Name { get; set; }
Property Value
Teams
Per-team behavior of the phase.
[UsedImplicitly]
public IReadOnlyList<TTeamSettings>? Teams { get; set; }
Property Value
- IReadOnlyList<TTeamSettings>
TimeElapsedSinceActive
[UsedImplicitly]
public TimeSpan TimeElapsedSinceActive { get; }
Property Value
TimeStarted
public DateTime TimeStarted { get; }
Property Value
Methods
BeginPhaseAsync(CancellationToken)
Activates the phase. This should happen just after the old phase ended if there was one.
public virtual UniTask BeginPhaseAsync(CancellationToken token = default)
Parameters
tokenCancellationToken
Returns
- UniTask
Remarks
EndPhaseAsync(CancellationToken)
Deactivates the phase.
public virtual UniTask EndPhaseAsync(CancellationToken token = default)
Parameters
tokenCancellationToken
Returns
- UniTask
InitializePhaseAsync(CancellationToken)
Invoked before the layout starts. Meant to be used for loading extra configuration information.
public virtual UniTask InitializePhaseAsync(CancellationToken token = default)
Parameters
tokenCancellationToken
Returns
- UniTask
ShouldBeInvincible(WarfarePlayer)
Determines if a player should currently be invincible.
protected virtual bool ShouldBeInvincible(WarfarePlayer player)
Parameters
playerWarfarePlayer
Returns
UpdatePlayerInvinciblity(WarfarePlayer)
Double-check whether the player should be currently invincible.
public void UpdatePlayerInvinciblity(WarfarePlayer player)
Parameters
playerWarfarePlayer