Exemple #1
0
        /// <summary>
        /// Creates object label from object
        /// </summary>
        /// <param name="obj">The object</param>
        /// <returns>The label</returns>
        public override IObjectLabelUI CreateLabel(ICategoryObject obj)
        {
            if (obj is IProperties)
            {
                IProperties p  = obj as IProperties;
                object      pr = p.Properties;
                if (pr != null)
                {
                    if (pr is IObjectLabelUI)
                    {
                        return(pr as IObjectLabelUI);
                    }
                }
            }
            Type t = obj.GetType();

            if (t.Equals(typeof(ObjectsCollection)))
            {
                ObjectsCollection coll = obj as ObjectsCollection;
                if (coll.Type.Equals(typeof(Regression.AliasRegression)))
                {
                    return((new DataPerformer.UI.Labels.FisherLabel()).CreateLabelUI(null, false));
                }
            }
            return(CreateObjectLabel(t, "", null));
        }
 public static ObjectsCollection GetAll() {
     resourceSchema.Dal.Objects dbo = null;
     try {
         dbo = new resourceSchema.Dal.Objects();
         System.Data.DataSet ds = dbo.Objects_Select_All();
         ObjectsCollection collection = new ObjectsCollection();
         if (GlobalTools.IsSafeDataSet(ds)) {
             for (int i = 0; (i < ds.Tables[0].Rows.Count); i = (i + 1)) {
                 Objects obj = new Objects();
                 obj.Fill(ds.Tables[0].Rows[i]);
                 if ((obj != null)) {
                     collection.Add(obj);
                 }
             }
         }
         return collection;
     }
     catch (System.Exception ) {
         throw;
     }
     finally {
         if ((dbo != null)) {
             dbo.Dispose();
         }
     }
 }
Exemple #3
0
 public void ResetDynamicObjectsState()
 {
     foreach (var dynamicObject in ObjectsCollection.OfType <IDynamicObject>())
     {
         dynamicObject.Updated = false;
     }
 }
Exemple #4
0
        public IDestroyableObject GetBiggestDestroyable()
        {
            var destroyable    = ObjectsCollection.OfType <IDestroyableObject>().ToArray();
            var bigDestroyable = destroyable.FirstOrDefault(obj => obj.BlocksMovement);

            if (bigDestroyable != null)
            {
                return(bigDestroyable);
            }
            return(destroyable.LastOrDefault());
        }
Exemple #5
0
        private void ProcessDynamicObjects(Point position, UpdateOrder updateOrder)
        {
            var dynamicObjects = ObjectsCollection.OfType <IDynamicObject>()
                                 .Where(obj => !obj.Updated && obj.UpdateOrder == updateOrder).ToArray();

            foreach (var dynamicObject in dynamicObjects)
            {
                dynamicObject.Update(position);
                dynamicObject.Updated = true;
            }
        }
Exemple #6
0
        private void ProcessDestroyableObjects(IAreaMap map, Point position)
        {
            var destroyableObjects = ObjectsCollection.OfType <IDestroyableObject>().ToArray();

            ProcessStatusesAndEnvironment(destroyableObjects, position);

            var deadObjects = destroyableObjects.Where(obj => obj.Health <= 0).ToArray();

            foreach (var deadObject in deadObjects)
            {
                map.RemoveObject(position, deadObject);
                deadObject.OnDeath(position);
            }
        }
Exemple #7
0
        private void CheckSpreadingObjects(IAreaMapCellInternal other)
        {
            var localSpreadingObjects = ObjectsCollection.OfType <ISpreadingObject>().ToArray();
            var otherSpreadingObjects = other.ObjectsCollection.OfType <ISpreadingObject>().ToArray();

            foreach (var spreadingObject in localSpreadingObjects)
            {
                if (spreadingObject.Volume >= spreadingObject.MaxVolumeBeforeSpread)
                {
                    SpreadObject(spreadingObject, other);
                }
            }

            foreach (var otherSpreadingObject in otherSpreadingObjects)
            {
                if (otherSpreadingObject.Volume >= otherSpreadingObject.MaxVolumeBeforeSpread)
                {
                    SpreadObject(otherSpreadingObject, this);
                }
            }
        }
Exemple #8
0
 public SimpleDiConfigurationSection()
 {
     base["objects"] = new ObjectsCollection();
 }
Exemple #9
0
 public void ClearObjects()
 {
     Objects = new ObjectsCollection(false);
 }
Exemple #10
0
 public void RemoveVolume <T>(int volume) where T : IVolumeObject
 {
     ObjectsCollection.RemoveVolume <T>(volume);
 }
Exemple #11
0
 public int GetVolume <T>() where T : IVolumeObject
 {
     return(ObjectsCollection.GetVolume <T>());
 }