Example #1
0
        public void ConstructStoryLines(StoryViewModel storyModel, StoryLineViewModel parent, IScene startScene, int depth, IStorylinePositioner storylineAdder)
        {            
            IScene currentScene = startScene;

            StoryLineViewModel lineScenes = new StoryLineViewModel(storyModel, parent);
            lineScenes.Depth = depth;            

            storylineAdder.Position(lineScenes);

            int padding = depth;
            while (currentScene != null)
            {
                padding++;
                lineScenes.Add(new SceneViewModel(currentScene));
                InteractiveScene interactiveScene = currentScene as InteractiveScene;
                if (null != interactiveScene && interactiveScene.Type == SceneType.Interactive)
                {
                    foreach (IScene possibleStartScene in interactiveScene.PossibleScenes)
                    {
                        ConstructStoryLines(storyModel, lineScenes, possibleStartScene, padding, storylineAdder);
                    }

                    break;
                }
                else
                {
                    currentScene = currentScene.FollowingScene;
                }
            }

            lineScenes.CollectionChanged += lineScenes_CollectionChanged;
        }
Example #2
0
 public ObservableCollection<StoryLineViewModel> ConstructStoryLines(StoryViewModel storyModel)
 {
     storyModel.StoryLines.Clear();
     if (storyModel.Story.StartScene != null)
     {
         ConstructStoryLines(storyModel, null, storyModel.Story.StartScene, 0, new StorylineAdder(storyModel.StoryLines));
     }
     return storyModel.StoryLines;
 }
Example #3
0
        private void SetDefaultContext()
        {
            libraryViewModel.Library = Library.Current = new Library();
            projectViewModel.Library = libraryViewModel;
            Story story = new Story();
            StoryViewModel storyModel = new StoryViewModel(story);
            projectViewModel.Story = storyModel;
            projectViewModel.StoryRendererViewModel = new StoryRendererViewModel(story);

            this.DataContext = projectViewModel;
        }
Example #4
0
 internal StoryLineViewModel CreateStoryLine(StoryViewModel storyViewModel)
 {
     StoryLineViewModel storylineModel = new StoryLineViewModel(storyViewModel, null);
     storylineModel.CollectionChanged += lineScenes_CollectionChanged;
     return storylineModel;
 }
Example #5
0
 private void HandleReorder(StoryViewModel storyModel, StoryLineViewModel storyline)
 {
     //storyModel.Story = storyModel.Story;
     storyModel.RefreshScenes(storyline);
 }