mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Make Mod IJsonSerializable
This commit is contained in:
parent
c5d2dc2f6a
commit
ea52d2d527
@ -3,17 +3,20 @@
|
||||
|
||||
using osu.Game.Graphics;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.IO.Serialization;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// The base class for gameplay modifiers.
|
||||
/// </summary>
|
||||
public abstract class Mod
|
||||
public abstract class Mod : IJsonSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of this mod.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public abstract string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
@ -24,36 +27,43 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// <summary>
|
||||
/// The icon of this mod.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual FontAwesome Icon => FontAwesome.fa_question;
|
||||
|
||||
/// <summary>
|
||||
/// The type of this mod.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual ModType Type => ModType.Fun;
|
||||
|
||||
/// <summary>
|
||||
/// The user readable description of this mod.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual string Description => string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The score multiplier of this mod.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public abstract double ScoreMultiplier { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this mod is implemented (and playable).
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual bool HasImplementation => this is IApplicableMod;
|
||||
|
||||
/// <summary>
|
||||
/// Returns if this mod is ranked.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual bool Ranked => false;
|
||||
|
||||
/// <summary>
|
||||
/// The mods this mod cannot be enabled with.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual Type[] IncompatibleMods => new Type[] { };
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user