示例#1
0
            public FactionScienceInfo(FactionInfo faction)
            {
                Faction     = faction;
                Name        = Faction.Name;
                Description = faction.Description;

                if (!string.IsNullOrEmpty(faction.Logo))
                {
                    Images.Add(faction.Logo);
                }
            }
示例#2
0
        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);
        }
示例#3
0
        public Relations GetRelationship(FactionInfo other)
        {
            if (ID == other.ID)
            {
                return(Relations.Friendly);
            }

            if (!Relationships.ContainsKey(other.ID))
            {
                return(Relations.Unaware);
            }

            return(Relationships[other.ID]);
        }
示例#4
0
        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);
            }
        }
示例#5
0
 public static List <FactionInfo> GetFactionsWithRelation(FactionInfo faction, FactionInfo.Relations relation)
 {
     return(Factions.FindAll((x) => x != faction && x.GetRelationship(faction) == relation));
 }