Exemplo n.º 1
0
        public string CreateScene(FolderViewModel folder, string sceneName)
        {
            var model = new SavedSceneModel()
            {
                SceneActors = new SavedSceneActor[0],
                SceneName = sceneName
            };

            ApplicationUtils.SaveSceneInFolder(model, folder.FolderFullPath);
            return ApplicationUtils.GetPathOfSceneInFolder(model, folder.FolderFullPath);
        }
Exemplo n.º 2
0
        public string CreateScene(string sceneName)
        {
            var model = new SavedSceneModel()
            {
                SceneActors = new SavedSceneActor[0],
                SceneName = sceneName
            };

            ApplicationUtils.SaveScene(model);
            return ApplicationUtils.GetPathOf(model);
        }
Exemplo n.º 3
0
 public static SavedSceneModel ToSaveModel(this Scene scene)
 {
     var model = new SavedSceneModel();
     var sceneActors = new List<SavedSceneActor>();
     //IEnumerable<ActorWidgetAdapter> widgetActors = scene.WorldEntities.OfType<ActorWidgetAdapter>();
     //foreach (ActorWidgetAdapter widget in widgetActors)
     var actors = scene.WorldEntities;
     foreach (var ba in actors)
     {
         //BaseActor ba = widget.BaseActor;
         var t = ba.GetType();
         var sceneActor = new SavedSceneActor()
         {
              Module = t.Module.Name,
              ActorType = t.FullName
         };
         sceneActors.Add(sceneActor);
     }
     model.SceneActors = sceneActors.ToArray();
     model.SceneName = scene.SceneName;
     return model;
 }
Exemplo n.º 4
0
 public static void SaveSceneInFolder(SavedSceneModel scene, string folderPath)
 {
     var scenePath = GetPathOfSceneInFolder(scene.SceneName, folderPath);
     XMLSerializerUtils.SerializeToXML(scene, scenePath);
 }
Exemplo n.º 5
0
 public static void SaveScene(SavedSceneModel scene)
 {
     var scenePath = GetPathOf(scene);
     XMLSerializerUtils.SerializeToXML(scene, scenePath);
 }
Exemplo n.º 6
0
 public static string GetPathOfSceneInFolder(SavedSceneModel scene, string folderPath)
 {
     return GetPathOfSceneInFolder(scene.SceneName, folderPath);
 }
Exemplo n.º 7
0
 public static string GetPathOf(SavedSceneModel scene)
 {
     return GetPathOfScene(scene.SceneName);
 }