SetLegacyEditorInfo() public method

Sets the editor info for this level from properties obtained from legacy version of Gleed2D.
public SetLegacyEditorInfo ( LegacyEditorInfo legacyEditorInfo ) : void
legacyEditorInfo LegacyEditorInfo
return void
        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);
        }
Beispiel #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 ) ;
        }