Пример #1
0
 /// <summary>
 /// Prevents a default instance of the <see cref="Project"/> class from being created.
 /// </summary>
 /// <param name="projectDirectory">The project directory.</param>
 private Project(string projectDirectory)
 {
     _singleton       = this;
     _name            = "NewProject";
     ProjectDirectory = projectDirectory;
     _textures        = new TexturesManager();
     _animations      = new AnimationsManager();
     _sounds          = new SoundsManager();
     _scenes          = new ScenesManager();
     _actorTypes      = new ActorTypesManager();
     _prototypes      = new ObservableList <Actor>();
     _settings        = new ProjectSettings();
 }
Пример #2
0
        /// <summary>
        /// Deserialize object.
        /// </summary>
        /// <param name="info">The <see cref="System.Runtime.Serialization.SerializationInfo"/> to retrieve data.</param>
        /// <param name="ctxt">The source (see <see cref="System.Runtime.Serialization.StreamingContext"/>) for this deserialization.</param>
        private Project(SerializationInfo info, StreamingContext ctxt)
        {
            Debug.Assert(ctxt.Context != null && ctxt.Context is string, "No project directory given.");

            _singleton       = this;
            _name            = info.GetString("Name");
            ProjectDirectory = ctxt.Context.ToString();
            _actorTypes      = (ActorTypesManager)info.GetValue("ActorTypes", typeof(ActorTypesManager));
            info.GetValue("ContentManager", typeof(ContentManager));
            _textures   = (TexturesManager)info.GetValue("Textures", typeof(TexturesManager));
            _animations = (AnimationsManager)info.GetValue("Animations", typeof(AnimationsManager));
            _sounds     = (SoundsManager)info.GetValue("Sounds", typeof(SoundsManager));
            _scenes     = (ScenesManager)info.GetValue("Scenes", typeof(ScenesManager));
            _prototypes = (ObservableList <Actor>)info.GetValue("Prototypes", typeof(ObservableList <Actor>));
            _settings   = (ProjectSettings)info.GetValue("Settings", typeof(ProjectSettings));
        }