示例#1
0
        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;
        }
示例#2
0
 public static bool allied( Faction a, Faction b )
 {
     Faction other;
     return allianceMap_.TryGetValue( a, out other ) && other == b;
 }
示例#3
0
 public static Faction allyFor( Faction faction )
 {
     Faction ally;
     return allianceMap_.TryGetValue( faction, out ally ) ? ally : null;
 }
示例#4
0
 public static void add( string name, Faction faction )
 {
     var player = find ( name );
     if ( player != null )
         player.faction = faction;
 }