Table of Contents

Interface ITeamManager<TTeam>

Namespace
Uncreated.Warfare.Layouts.Teams
Assembly
Uncreated.Warfare.dll

Generic interface used to manage an abstract number of teams.

public interface ITeamManager<out TTeam> where TTeam : Team

Type Parameters

TTeam

Properties

AdminGroupId

The group admins can join when placing buildables or doing other duties where they shouldn't be in a group.

CSteamID AdminGroupId { get; }

Property Value

CSteamID

AllTeams

List of all teams currently active.

IReadOnlyList<out TTeam> AllTeams { get; }

Property Value

IReadOnlyList<TTeam>

Configuration

Team manager extra configuration from config file.

IConfiguration? Configuration { get; }

Property Value

IConfiguration

Methods

BeginAsync(CancellationToken)

Activates the team manager. This happens just before the first phase is activated.

UniTask BeginAsync(CancellationToken token = default)

Parameters

token CancellationToken

Returns

UniTask

EndAsync(CancellationToken)

Deactivates the team manager.

UniTask EndAsync(CancellationToken token = default)

Parameters

token CancellationToken

Returns

UniTask

FindTeam(string?)

Find a team from a string value, such as from config.

TTeam? FindTeam(string? teamSearch)

Parameters

teamSearch string

Can be (in order of priority) A faction name, a team ID, 'blufor', or 'opfor'.

Returns

TTeam

GetLayoutRole(Team)

Gets the role of the team in the current layout.

LayoutRole GetLayoutRole(Team team)

Parameters

team Team

Returns

LayoutRole

GetSpawnPointWhenRespawningAtMain(IPlayer, Team, ZoneStore)

Gets the desired spawn point when a player needs to respawn at main base.

Vector4? GetSpawnPointWhenRespawningAtMain(IPlayer player, Team team, ZoneStore globalZoneStore)

Parameters

player IPlayer
team Team
globalZoneStore ZoneStore

Returns

Vector4?

The spawn position as a UnityEngine.Vector4, where UnityEngine.Vector4.w is yaw rotation.

Remarks

The player may not have joined the server yet.

GetTeam(CSteamID)

Will return the default team if groupId doesn't correspond to a team, otherwise the "no team" default.

TTeam GetTeam(CSteamID groupId)

Parameters

groupId CSteamID

Returns

TTeam

InitializeAsync(CancellationToken)

Used to initialize team info from the layout and map configuration.

UniTask InitializeAsync(CancellationToken token = default)

Parameters

token CancellationToken

Returns

UniTask

JoinTeamAsync(WarfarePlayer, Team, bool, CancellationToken)

Joins a player into a team if they're not already.

UniTask JoinTeamAsync(WarfarePlayer player, Team team, bool wasByAdminCommand, CancellationToken token = default)

Parameters

player WarfarePlayer
team Team
wasByAdminCommand bool
token CancellationToken

Returns

UniTask