Add setter to legacy skin configuration access

This commit is contained in:
iiSaLMaN 2019-11-20 01:15:40 +03:00
parent 0407d2248c
commit 08b8cedfdf
1 changed files with 7 additions and 3 deletions

View File

@ -26,7 +26,11 @@ public class LegacySkin : Skin
[CanBeNull] [CanBeNull]
protected IResourceStore<SampleChannel> Samples; protected IResourceStore<SampleChannel> Samples;
protected new LegacySkinConfiguration Configuration => (LegacySkinConfiguration)base.Configuration; protected new LegacySkinConfiguration Configuration
{
get => base.Configuration as LegacySkinConfiguration;
set => base.Configuration = value;
}
public LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager audioManager) public LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager audioManager)
: this(skin, new LegacySkinResourceStore<SkinFileInfo>(skin, storage), audioManager, "skin.ini") : this(skin, new LegacySkinResourceStore<SkinFileInfo>(skin, storage), audioManager, "skin.ini")
@ -41,10 +45,10 @@ protected LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager
if (stream != null) if (stream != null)
{ {
using (LineBufferedReader reader = new LineBufferedReader(stream)) using (LineBufferedReader reader = new LineBufferedReader(stream))
base.Configuration = new LegacySkinDecoder().Decode(reader); Configuration = new LegacySkinDecoder().Decode(reader);
} }
else else
base.Configuration = new LegacySkinConfiguration { LegacyVersion = LegacySkinConfiguration.LATEST_VERSION }; Configuration = new LegacySkinConfiguration { LegacyVersion = LegacySkinConfiguration.LATEST_VERSION };
if (storage != null) if (storage != null)
{ {