mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Move in-memory logic to a base class
This commit is contained in:
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.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Configuration;
|
|
||||||
|
|
||||||
namespace osu.Game.Configuration
|
namespace osu.Game.Configuration
|
||||||
{
|
{
|
||||||
public class SessionStatics : ConfigManager<Statics>
|
public class SessionStatics : InMemoryConfigManager<Statics>
|
||||||
{
|
{
|
||||||
// This is an in-memory store.
|
protected override void InitialiseDefaults()
|
||||||
protected override void PerformLoad()
|
|
||||||
{
|
{
|
||||||
|
Set(Statics.LoginOverlayDisplayed, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool PerformSave() => true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Statics
|
public enum Statics
|
||||||
|
Reference in New Issue
Block a user