private void ReloadList()
        {
            ObjectsList.Clear();
            ObjectListBox.ItemsSource = null;
            RefreshObjectColumns(ObjectListBox);

            var SceneObjects       = _SceneObjects.Select(y => y.Name.ToString()).OrderBy(x => x.ToString());
            var StageConfigObjects = _StageConfigObjects.OrderBy(x => x.ToString());
            var GameConfigObjects  = _GameConfigObjects.OrderBy(sso => sso.ToString());

            var AllObjects = SceneObjects.Union(StageConfigObjects).OrderBy(sso => sso.ToString());

            int index = 0;

            foreach (var name in AllObjects)
            {
                if (SceneObjects.Contains(name))
                {
                    var lvc = GenerateListEntry(name, index, SceneObjects, GameConfigObjects, StageConfigObjects);
                    ObjectsList.Add(lvc);
                    index++;
                }
                else
                {
                    var lvc = GenerateListEntry(name, -1, SceneObjects, GameConfigObjects, StageConfigObjects);
                    ObjectsList.Add(lvc);
                }
            }

            ObjectListBox.ItemsSource = VisibleObjectsList;
            UpdateSelectionControls();
        }
 public override void AjouteObjet(ObjetAbstrait obj)
 {
     if (!ObjectsList.Contains(obj))
     {
         ObjectsList.Add(obj);
     }
 }
Example #3
0
    public void SetupObjects(ConstrainedObjectEx co)
    {
        // Add all movers, assuming a list on the format "0.5*object1+0.5*object2"
        string[] moversStrings = co.moversName.Split('+');
        //co.movers.Clear();
        for (int i = 0; i < moversStrings.Length; i++)
        {
            ConstrainedObjectEx.ConstrainedObjectMover mover =
                new ConstrainedObjectEx.ConstrainedObjectMover();

            string[] strings = moversStrings[i].Split('*');
            if (strings.Length < 1 || strings.Length > 2)
            {
                Debug.LogError("[FXModuleConstrinPositionEx]: Every mover must be on the form '0.1*transformName' or 'transformName'");
                return;
            }
            mover.weight = 1.0;
            if (strings.Length == 1)
            {
                mover.transformName = strings[0];
            }
            else
            {
                mover.weight        = double.Parse(strings[0]);
                mover.transformName = strings[1];
            }

            co.movers.Add(mover);
        }

        if (co.movers.Count >= 1)
        {
            ObjectsList.Add(co);
        }
    }
Example #4
0
 private void ReloadAssembly()
 {
     LoadAssembly();
     ObjectsList.Clear();
     if (LoadedAssemblyRepresentation != null)
     {
         TreeViewItem item = new AssemblyItem((AssemblyMetadata)LoadedAssemblyRepresentation);
         ObjectsList.Add(item);
         SaveModel.RaiseCanExecuteChanged();
         ObjectSelected = item;
     }
 }
Example #5
0
    public void ChangeLayer(Object obj, int layer)
    {
        if (Objects.Count > 0)
        {
            List <int> Indexes = new List <int>();

            Objects.Remove(obj);
            obj.LAYER = layer;
            QuickSortDic.Clear();
            List <Object> ObjectsList;
            for (int i = 0; i < Objects.Count; i++)
            {
                QuickSortDic.TryGetValue(Objects[i].LAYER, out ObjectsList);
                if (ObjectsList == null)
                {
                    QuickSortDic.Add(Objects[i].LAYER, new List <Object>());
                    QuickSortDic.TryGetValue(Objects[i].LAYER, out ObjectsList);
                    Indexes.Add(Objects[i].LAYER);
                }
                ObjectsList.Add(Objects[i]);
            }
            QuickSortDic.TryGetValue(obj.LAYER, out ObjectsList);
            if (ObjectsList == null)
            {
                QuickSortDic.Add(obj.LAYER, new List <Object>());
                QuickSortDic.TryGetValue(obj.LAYER, out ObjectsList);
                Indexes.Add(obj.LAYER);
            }
            ObjectsList.Add(obj);
            Indexes.Sort();
            Objects.Clear();
            foreach (int index in Indexes)
            {
                QuickSortDic.TryGetValue(index, out ObjectsList);
                foreach (Object _obj in ObjectsList)
                {
                    Objects.Add(_obj);
                }
            }
            QuickSortDic.Clear();
        }
        else
        {
            Objects.Add(obj);
        }
    }
        public void ResetHeapData()
        {
            ObjectsList.Clear();
            ObjectTypeCodes.Clear();
            ReferenceCodes.Clear();
            FieldReferenceCodes.Clear();
            RealObjectCount = 1;

            // The 'unknown' object
            ObjectInfo ob = new ObjectInfo();

            ob.Code      = ObjectMapReader.UnknownObjectId;
            ob.Size      = 0;
            ob.RefsIndex = 0;
            ob.RefsCount = 0;
            ObjectTypeCodes.Add(ObjectMapReader.UnknownTypeId);
            ObjectsList.Add(ob);
        }
Example #7
0
 public override void AjouteObjet(ObjetAbstrait obj)
 {
     ObjectsList.Add(obj);
 }
Example #8
0
        private async Task Load(ISourceProvider targetPathProvider)
        {
            if (targetPathProvider == null)
            {
                throw new ArgumentNullException(nameof(targetPathProvider), "SourceProvider can't be null.");
            }

            if (Persister.FileSystemDependency == FileSystemDependency.Independent)
            {
                targetPathProvider = new NullSourceProvider();
            }

            if (targetPathProvider.GetAccess())
            {
                try
                {
                    string            target = targetPathProvider.GetPath();
                    IAssemblyMetadata result = await Task.Run(
                        async() => await LoadRootAssembly(target));

                    if (result is null)
                    {
                        const string errorMessage = "Repository doesn't contain any elements";
                        ErrorMessageTarget.SendMessage("Loading error", errorMessage);
                        if (IsTracingEnabled)
                        {
                            Tracer.LogFailure($"{target}; {errorMessage}");
                            Tracer.Flush();
                        }
                    }
                    else
                    {
                        ObjectsList.Clear();
                        ObjectsList.Add(new AssemblyItem(result as AssemblyMetadata));
                        LoadedAssembly = "Model deserialized";
                        SaveModel.RaiseCanExecuteChanged();
                        InformationMessageTarget?.SendMessage("Loading completed", "Model was successfully loaded.");

                        if (IsTracingEnabled)
                        {
                            Tracer.LogModelLoaded(target);
                            Tracer.Flush();
                        }
                    }
                }
                catch (Exception ex)
                {
                    ErrorMessageTarget.SendMessage("Loading error", ex.Message);
                    if (IsTracingEnabled)
                    {
                        Tracer.LogFailure(
                            $"Exception caught when trying to open a file for reading {Environment.NewLine}{ex.Message}");
                        Tracer.Flush();
                    }
                }
            }
            else
            {
                ErrorMessageTarget.SendMessage("Target in use", "File you tried to open is currently in use by another program");
            }
        }
Example #9
0
 public static void AddObject(object obj)
 {
     ObjectsList.Add(obj);
 }
Example #10
0
        public void Add(MapObject mapObject)
        {
            ObjectsList.Add(mapObject);

            LastModifiedAt = DateTimeOffset.UtcNow;
        }
 public virtual bool Add(IDrawable drawable)
 {
     list.Add(drawable);
     return(true);
 }
Example #12
0
 private ScenarioElement CreateObject(Point position, DynamicElement obj)
 {
     ObjectsList.Add(obj);
     return(obj);
 }
Example #13
0
 public override void ChargerObjets(FabriqueAbstraite fabrique)
 {
     ObjectsList.Add(fabrique.CreerObjet("oeuf"));
 }