public FactionScienceInfo(FactionInfo faction) { Faction = faction; Name = Faction.Name; Description = faction.Description; if (!string.IsNullOrEmpty(faction.Logo)) { Images.Add(faction.Logo); } }
public static FactionInfo AddFaction(string name) { if (name == null || string.IsNullOrEmpty(name) || Factions.Find((x) => x.Name == name) != null) { return(null); } FactionInfo info = new FactionInfo(); info.ID = Factions.Count + 1; info.Name = name; Factions.Add(info); return(info); }
public Relations GetRelationship(FactionInfo other) { if (ID == other.ID) { return(Relations.Friendly); } if (!Relationships.ContainsKey(other.ID)) { return(Relations.Unaware); } return(Relationships[other.ID]); }
public void SetRelationShip(FactionInfo other, Relations relation, bool mutual = false) { if (ID == other.ID) { return; } if (!Relationships.ContainsKey(other.ID)) { Relationships.Add(other.ID, relation); } else { Relationships[other.ID] = relation; } if (mutual) { other.SetRelationShip(this, relation); } }
public static List <FactionInfo> GetFactionsWithRelation(FactionInfo faction, FactionInfo.Relations relation) { return(Factions.FindAll((x) => x != faction && x.GetRelationship(faction) == relation)); }