mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:17:23 +08:00
Move in-memory logic to a base class
This commit is contained in:
parent
267e12ce3c
commit
d013b73d33
22
osu.Game/Configuration/InMemoryConfigManager.cs
Normal file
22
osu.Game/Configuration/InMemoryConfigManager.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public class InMemoryConfigManager<T> : ConfigManager<T>
|
||||
where T : struct
|
||||
{
|
||||
public InMemoryConfigManager()
|
||||
{
|
||||
InitialiseDefaults();
|
||||
}
|
||||
|
||||
protected override void PerformLoad()
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool PerformSave() => true;
|
||||
}
|
||||
}
|
@ -1,18 +1,14 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public class SessionStatics : ConfigManager<Statics>
|
||||
public class SessionStatics : InMemoryConfigManager<Statics>
|
||||
{
|
||||
// This is an in-memory store.
|
||||
protected override void PerformLoad()
|
||||
protected override void InitialiseDefaults()
|
||||
{
|
||||
Set(Statics.LoginOverlayDisplayed, false);
|
||||
}
|
||||
|
||||
protected override bool PerformSave() => true;
|
||||
}
|
||||
|
||||
public enum Statics
|
||||
|
Loading…
Reference in New Issue
Block a user