public static Faction find( string name ) { Faction faction; if ( factions_.TryGetValue( name.ToLower(), out faction ) ) return faction; faction = new Faction( name ); factions_[name.ToLower()] = faction; return faction; }
public static bool allied( Faction a, Faction b ) { Faction other; return allianceMap_.TryGetValue( a, out other ) && other == b; }
public static Faction allyFor( Faction faction ) { Faction ally; return allianceMap_.TryGetValue( faction, out ally ) ? ally : null; }
public static void add( string name, Faction faction ) { var player = find ( name ); if ( player != null ) player.faction = faction; }