public enum Team
{
    Defenders,
    Attackers,
}

public static class TeamExtension
{
    public static Team GetOppositeTeam(this Team team)
    {
        if (team == Team.Attackers)
            return Team.Defenders;
        else
            return Team.Attackers;
    }
}