예제 #1
0
 public UndertaleTextureGroupInfo()
 {
     TexturePages = new UndertaleSimpleResourcesList <UndertaleEmbeddedTexture, UndertaleChunkTXTR>();
     Sprites      = new UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT>();
     SpineSprites = new UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT>();
     Fonts        = new UndertaleSimpleResourcesList <UndertaleFont, UndertaleChunkFONT>();
     Tilesets     = new UndertaleSimpleResourcesList <UndertaleBackground, UndertaleChunkBGND>();
 }
    /// <inheritdoc/>
    public void Dispose()
    {
        GC.SuppressFinalize(this);

        Name         = null;
        TexturePages = null;
        Sprites      = null;
        SpineSprites = null;
        Fonts        = null;
        Tilesets     = null;
    }
        public void Unserialize(UndertaleReader reader)
        {
            Name = reader.ReadUndertaleString();

            // Read the pointers
            TexturePages = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleEmbeddedTexture, UndertaleChunkTXTR> >();
            Sprites      = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >();
            SpineSprites = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >();
            Fonts        = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleFont, UndertaleChunkFONT> >();
            Tilesets     = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleBackground, UndertaleChunkBGND> >();

            // Read the objects, throwing an error if the pointers are invalid
            reader.ReadUndertaleObject(TexturePages);
            reader.ReadUndertaleObject(Sprites);
            reader.ReadUndertaleObject(SpineSprites);
            reader.ReadUndertaleObject(Fonts);
            reader.ReadUndertaleObject(Tilesets);
        }
예제 #4
0
        public void Unserialize(UndertaleReader reader)
        {
            Name = reader.ReadUndertaleString();

            // Read the pointers
            TexturePages = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleEmbeddedTexture, UndertaleChunkTXTR> >();
            Sprites      = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >();
            SpineSprites = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >();
            Fonts        = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleFont, UndertaleChunkFONT> >();
            Tilesets     = reader.ReadUndertaleObjectPointer <UndertaleSimpleResourcesList <UndertaleBackground, UndertaleChunkBGND> >();

            // Read the objects, throwing an error if the pointers are invalid
            if (reader.ReadUndertaleObject <UndertaleSimpleResourcesList <UndertaleEmbeddedTexture, UndertaleChunkTXTR> >() != TexturePages ||
                reader.ReadUndertaleObject <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >() != Sprites ||
                reader.ReadUndertaleObject <UndertaleSimpleResourcesList <UndertaleSprite, UndertaleChunkSPRT> >() != SpineSprites ||
                reader.ReadUndertaleObject <UndertaleSimpleResourcesList <UndertaleFont, UndertaleChunkFONT> >() != Fonts ||
                reader.ReadUndertaleObject <UndertaleSimpleResourcesList <UndertaleBackground, UndertaleChunkBGND> >() != Tilesets)
            {
                throw new UndertaleSerializationException("Invalid pointer to SimpleResourcesList");
            }
        }