Table of Contents

Class BasePhase<TTeamSettings>

Namespace
Uncreated.Warfare.Layouts.Phases
Assembly
Uncreated.Warfare.dll
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

serviceProvider IServiceProvider
config IConfiguration

Fields

Layout

protected readonly Layout Layout

Field Value

Layout

TeamManager

protected readonly ITeamManager<Team> TeamManager

Field Value

ITeamManager<Team>

Properties

Configuration

The configuration section used to create this phase.

public IConfiguration Configuration { get; }

Property Value

IConfiguration

Duration

[UsedImplicitly]
public TimeSpan Duration { get; set; }

Property Value

TimeSpan

Invincible

If all players can't take damage. Overrides Invincible if true.

[UsedImplicitly]
public bool Invincible { get; set; }

Property Value

bool

IsActive

If this phase is currently activated.

public bool IsActive { get; }

Property Value

bool

Logger

protected ILogger Logger { get; }

Property Value

ILogger

Name

Display name of the phase on the popup toast for all teams.

[UsedImplicitly]
public TranslationList? Name { get; set; }

Property Value

TranslationList

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

TimeSpan

TimeStarted

public DateTime TimeStarted { get; }

Property Value

DateTime

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

token CancellationToken

Returns

UniTask

Remarks

Must set IsActive to true or the phase will be skipped.

EndPhaseAsync(CancellationToken)

Deactivates the phase.

public virtual UniTask EndPhaseAsync(CancellationToken token = default)

Parameters

token CancellationToken

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

token CancellationToken

Returns

UniTask

ShouldBeInvincible(WarfarePlayer)

Determines if a player should currently be invincible.

protected virtual bool ShouldBeInvincible(WarfarePlayer player)

Parameters

player WarfarePlayer

Returns

bool

UpdatePlayerInvinciblity(WarfarePlayer)

Double-check whether the player should be currently invincible.

public void UpdatePlayerInvinciblity(WarfarePlayer player)

Parameters

player WarfarePlayer