Exemplo n.º 1
0
        /// <summary>
        /// Sets the editor info for this level from properties obtained
        /// from legacy version of Gleed2D.
        /// </summary>
        /// <param name="legacyEditorInfo"></param>
        public void SetLegacyEditorInfo(LegacyEditorInfo legacyEditorInfo)
        {
            var contentRootFolder = legacyEditorInfo.ContentRootFolder;

            _properties.ContentRootFolder = contentRootFolder;

            ObjectFactory.GetInstance <IModelEventHub>().Publish(new ContentRootChanged(contentRootFolder, contentRootFolder));

            _properties.NextItemNumber = legacyEditorInfo.NextItemNumber;
            _properties.Position       = legacyEditorInfo.CameraPosition;
            _properties.Version        = legacyEditorInfo.Version;
        }
Exemplo n.º 2
0
        void populateEditorRelatedStuff(LevelEditor level, XElement xml)
        {
            var assemblyInformation = ObjectFactory.GetInstance <IGetAssemblyInformation>( );

            XElement ourElement = xml.CertainElement(@"EditorRelated");

            XElement cameraPositionElement = ourElement.CertainElement(@"CameraPosition");

            var legacyEditorInfo = new LegacyEditorInfo
            {
                NextItemNumber    = (int)ourElement.CertainElement(@"NextItemNumber"),
                ContentRootFolder = (string)ourElement.CertainElement(@"ContentRootFolder"),
                CameraPosition    = new Vector2(
                    (float)cameraPositionElement.CertainElement(@"X"),
                    (float)cameraPositionElement.CertainElement(@"Y")),
                Version = assemblyInformation.Version
            };

            level.SetLegacyEditorInfo(legacyEditorInfo);
        }
Exemplo n.º 3
0
        void populateEditorRelatedStuff( LevelEditor level, XElement xml )
        {
            var assemblyInformation = ObjectFactory.GetInstance<IGetAssemblyInformation>( ) ;

            XElement ourElement = xml.CertainElement( @"EditorRelated" ) ;

            XElement cameraPositionElement = ourElement.CertainElement( @"CameraPosition" ) ;

            var legacyEditorInfo = new LegacyEditorInfo
                {
                    NextItemNumber = (int) ourElement.CertainElement( @"NextItemNumber" ),
                    ContentRootFolder = (string) ourElement.CertainElement( @"ContentRootFolder" ),
                    CameraPosition = new Vector2(
                        (float) cameraPositionElement.CertainElement( @"X" ),
                        (float) cameraPositionElement.CertainElement( @"Y" ) ),
                    Version = assemblyInformation.Version
                } ;

            level.SetLegacyEditorInfo( legacyEditorInfo ) ;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the editor info for this level from properties obtained
        /// from legacy version of Gleed2D.
        /// </summary>
        /// <param name="legacyEditorInfo"></param>
        public void SetLegacyEditorInfo( LegacyEditorInfo legacyEditorInfo )
        {
            var contentRootFolder = legacyEditorInfo.ContentRootFolder;

            _properties.ContentRootFolder = contentRootFolder ;

            ObjectFactory.GetInstance<IModelEventHub>().Publish(new ContentRootChanged(contentRootFolder, contentRootFolder));

            _properties.NextItemNumber = legacyEditorInfo.NextItemNumber ;
            _properties.Position = legacyEditorInfo.CameraPosition ;
            _properties.Version = legacyEditorInfo.Version ;
        }