Exemplo n.º 1
0
 public void AddTree(Tree tree)
 {
     ManagedObjects.Add(tree);
     tree.DirtyAdded = true;
     //TODO: Move into base
     //DrawingObjectManagerCollection.Current.FlagDirty();
 }
Exemplo n.º 2
0
        public override BasicLocus Create()
        {
            BasicLocus locus = Init(GetRandomLocusType());

            ManagedObjects.Add(locus);
            locus.OnCreated();
            return(locus);
        }
Exemplo n.º 3
0
        public void BuildNewRoute(double initialInvert, double gradient, List <DrainageVertex> vertices)
        {
            using (var acTrans = TransactionFactory.CreateFromNew())
            {
                var route = new DrainageRoute(initialInvert, gradient, vertices);
                route.CreateActiveObject();
                ManagedObjects.Add(route);
                acTrans.Commit();
            }

            UpdateAll();
        }
        /// <summary>
        /// Add new object to managed object collection
        /// </summary>
        /// <param name="toBeManaged">Object to be added. Dirty added does not need to be marked</param>
        public void Add(T toBeManaged)
        {
            if (!toBeManaged.Active)
            {
                throw new ArgumentException("Drawing object not active.");
            }

            ManagedObjects.Add(toBeManaged);
            toBeManaged.DirtyAdded = true;

            //TODO: Belt and Braces. Review implementation of Active and Managed object lists in line with dirty system.
            SetActiveObjects();
        }
Exemplo n.º 5
0
        internal void RegisterObject(Object obj)
        {
            lock (ManagedObjects)
            {
                if (ManagedObjects.Contains(obj))
                {
                    return;
                }

                OnObject.Invoke(obj);

                ManagedObjects.Add(obj);

                if (!(obj is GameObject gameObject))
                {
                    return;
                }

                if ((gameObject.Id.Flags & ObjectIdFlags.Spawned) != 0)
                {
                    SpawnedObjects.Add(gameObject);
                }
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Registers a <see cref="IManagedObject"/> which should be managed by the <see cref="HoloFlowSceneManager"/>
 /// </summary>
 public void RegisterObject(IManagedObject mObject)
 {
     ManagedObjects.Add(mObject);
 }