Teams
namespace Griff.Scenes;
public static class TeamsTeams, the one idea every genre shares: a name (“Player”, “Blue”) that a Team, a turn order’s Teams, a strategy faction or a network game’s Teams gives, and that anything on that team (see ITeamMember) carries. Names are the same team whatever their case and the spaces at their ends. Things on the same team are allies (they don’t hurt each other, take turns together and share the team’s items); things on different teams are foes; something on no team is neither.
Methods
Section titled “Methods”Allies
Section titled “Allies”public static bool Allies(string? a, string? b)True if both are on a team, the same one.
Allies
Section titled “Allies”public static bool Allies(Entity a, Entity b)True if a and b are on the same team (see Of).
public static bool Foes(string? a, string? b)True if both are on a team, different ones.
public static bool Foes(Entity a, Entity b)True if a and b are on different teams (see Of).
public static string Of(Entity? entity)The team entity is on: the first team named by a component on it (see ITeamMember), else on the nearest entity it’s inside (a sword’s hitbox is on its wielder’s team). Empty for none. Allocates nothing.
public static bool Same(string? a, string? b)True if a and b name the same team (ignoring case and spaces at the ends; two empty names are the same).
Fields
Section titled “Fields”public const string ScopeWhat a team’s name is a kind of, for Scope: every genre’s teams share it.