public CorporationHangarRentInfo GetCorporationHangarRentInfo()
        {
            var saveNeeded = false;

            if (!DynamicProperties.Contains(k.hangarPrice))
            {
                DynamicProperties.Update(k.hangarPrice, _corporationConfiguration.HangarPrice);
                saveNeeded = true;
            }

            if (!DynamicProperties.Contains(k.rentPeriod))
            {
                DynamicProperties.Update(k.rentPeriod, _corporationConfiguration.RentPeriod);
                saveNeeded = true;
            }

            if (saveNeeded)
            {
                this.Save();
            }

            return(new CorporationHangarRentInfo
            {
                price = DynamicProperties.GetOrAdd <int>(k.hangarPrice),
                period = TimeSpan.FromDays(DynamicProperties.GetOrAdd <int>(k.rentPeriod))
            });
        }
Example #2
0
        static bool Prefix(XmlElement _e)
        {
            if (!Configuration.CheckFeatureStatus(AdvFeatureClass, SecondFeature))
            {
                return(true);
            }

            PhysicsBodyColliderConfiguration physicsBodyColliderConfiguration = new PhysicsBodyColliderConfiguration();
            DynamicProperties dynamicProperties = new DynamicProperties();

            foreach (object obj in _e.ChildNodes)
            {
                XmlNode xmlNode = (XmlNode)obj;
                if (xmlNode.NodeType == XmlNodeType.Element && xmlNode.Name.Equals("property"))
                {
                    dynamicProperties.Add(xmlNode, true);
                }
            }

            AdvLogging.DisplayLog(AdvFeatureClass, "\n======= Physics Bodies ============");
            CheckTag(dynamicProperties, "tag");
            CheckTag(dynamicProperties, "path");
            CheckTag(dynamicProperties, "collisionLayer");
            CheckTag(dynamicProperties, "ragdollLayer");
            CheckTag(dynamicProperties, "layer");
            CheckTag(dynamicProperties, "ragdollScale");
            CheckTag(dynamicProperties, "type");
            CheckTag(dynamicProperties, "flags");

            if (dynamicProperties.Contains("collisionLayer"))
            {
                if (!dynamicProperties.Contains("ragdollLayer"))
                {
                    AdvLogging.DisplayLog(AdvFeatureClass, "\tWARNING: Collision Layer is set, but does not contain a ragdollLayer");
                }
            }
            else
            {
                if (!dynamicProperties.Contains("layer"))
                {
                    AdvLogging.DisplayLog(AdvFeatureClass, "\tWARNING: Collision Layer IS NOT SET. Falling back to layer property, but that is not found either! ");
                }
            }

            AdvLogging.DisplayLog(AdvFeatureClass, "======= End Physics Bodies ============");
            return(true);
        }
Example #3
0
        public override string ToString()
        {
            var info = base.ToString();

            if (DynamicProperties.Contains(k.target))
            {
                info += " RandomTarget: " + TargetDefinition;
            }

            return(info);
        }
Example #4
0
        public override void OnLoadFromDb()
        {
            if (DynamicProperties.Contains(k.depleted))
            {
                IsDepleted = DynamicProperties.GetOrAdd <int>(k.depleted) == 1;
            }
            else
            {
                DynamicProperties.Update(k.depleted, IsDepleted ? 1 : 0);
            }

            base.OnLoadFromDb();
        }
        private void Init()
        {
            EffectType currentEffect;

            if (DynamicProperties.Contains(k.currentEffect))
            {
                currentEffect = (EffectType)DynamicProperties.GetOrAdd <int>(k.currentEffect);
            }
            else
            {
                currentEffect = AvailableEffects.FirstOrDefault();
            }

            CurrentEffectType = currentEffect;
        }
Example #6
0
        static void CheckTag(DynamicProperties dynamicProperties, String strTag)
        {
            String strDisplay = "Property: " + strTag;

            if (dynamicProperties.Contains(strTag))
            {
                strDisplay += " Value: " + dynamicProperties.GetStringValue(strTag);
            }
            else
            {
                strDisplay += " Property is not set.";
            }

            AdvLogging.DisplayLog(AdvFeatureClass, strDisplay);
        }
        public override Dictionary <string, object> ToDictionary()
        {
            var info = base.ToDictionary();

            if (DynamicProperties.Contains(k.principal))
            {
                info.Add(k.principal, PrincipalCharacter.Id);
            }

            if (IsInAssignment())
            {
                info.Add(k.assignmentID, AssignmentId);
            }

            return(info);
        }
 public bool IsInAssignment()
 {
     return(DynamicProperties.Contains(k.assignmentID));
 }