Пример #1
0
        public StoryClip CreateStoryBlockClipItem(StoryClip parentUiItem)
        {
            if (parentUiItem == null)
            {
                parentUiItem = RootClip;
            }

            StoryClip item = new StoryClip(this);

            ItemCreated?.Invoke(item, parentUiItem);

            parentUiItem.AddChildItem(item);

            return(item);
        }
Пример #2
0
        public void RemoveStoryBlockItem(StoryBlockBase item)
        {
            if (item is StoryClip)
            {
                foreach (StoryBlockBase childItem in ((StoryClip)item).ChildItemList)
                {
                    RemoveStoryBlockItem(childItem);
                }
            }

            StoryClip parentItem = item.ParentItem;

            parentItem.ChildItemList.Remove(item);

            ItemRemoved?.Invoke(item, parentItem);
        }
Пример #3
0
        public JObject ToJObject()
        {
            JObject jFile = new JObject();

            //Add scenes
            JObject jScenes = new JObject();

            jFile.Add("Scenes", jScenes);

            foreach (KeyValuePair <string, Scene> scenePair in SceneDict)
            {
                JObject jScene = new JObject();
                jScenes.Add(scenePair.Key, jScene);

                Scene scene = scenePair.Value;
                jScene.Add(scene.ToJObject());
            }

            //Add clips
            JObject jClips = new JObject();

            jFile.Add("Clips", jClips);

            foreach (KeyValuePair <string, StoryClip> clipPair in ClipDict)
            {
                JObject jClip = new JObject();
                jClips.Add(clipPair.Key, jClip);

                StoryClip clip = clipPair.Value;
                jClip.Add(clip.ToJObject());
            }

            //Add rootClip
            JObject jRootClip = new JObject();

            jFile.Add("RootClip", RootClip.ToJObject());

            return(jFile);
        }
Пример #4
0
        private void CreateRootItem()
        {
            RootClip = new StoryClip(this);

            ItemCreated?.Invoke(RootClip, null);
        }