/// <summary> /// Checks If teamable and other have the same relation. /// </summary> /// <param name="teamable">This teamable.</param> /// <param name="other">The other teamable.</param> /// <returns>True if they have the same relation.</returns> public static bool IsRelationSymetric(this ITeamable teamable, ITeamable other) => teamable.GetRelation(other) == other.GetRelation(teamable);
public bool IsAllowed(ITeamable otherTeamable) { var relation = _teamable.GetRelation(otherTeamable); return(IsAllowed(relation)); }
/// <summary> /// Check if the provided relation is the relation from other to teamable. /// </summary> /// <param name="teamable">This teamable.</param> /// <param name="other">The other teamable.</param> /// <param name="relation">The relation to check.</param> /// <returns>True if the relation between the two is the same as the one provided.</returns> public static bool IsRelation(this ITeamable teamable, ITeamable other, TeamRelation relation) => teamable.GetRelation(other) == relation;