TeamRule
What a plugin declares to answer the team question, as teams()
does; at most one listed plugin declares one. The core walks an
entity’s controller and presence first, then asks findMembership for
the entity’s own team. As Unreal’s SetAttitudeSolver, one place
answers every system that asks.
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
teams |
readonly |
readonly Team[] |
The teams in play, in order. |
traits? |
public |
readonly Trait[] |
The traits its answers read, which a view of the answer, such as nameplates, watches to read it again as they change. |
Methods
Section titled “Methods”findMembership()
Section titled “findMembership()”findMembership(
world,entity):TeamMembership|null
The entity’s own team, or null where it has none: one of teams.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
entity |
Entity |
Returns
Section titled “Returns”TeamMembership | null
isFriendlyFireEnabled()
Section titled “isFriendlyFireEnabled()”isFriendlyFireEnabled(
world):boolean
Whether a hit between allies applies.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
Returns
Section titled “Returns”boolean
isTeamAlly()?
Section titled “isTeamAlly()?”
optionalisTeamAlly(world,first,second):boolean
Whether two teams fight on one side; one team is always its own ally. Left out, two teams are allies only when they are one. It must answer the same both ways round.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
first |
Team |
second |
Team |
Returns
Section titled “Returns”boolean