예제 #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));
 }