1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00
osu-lazer/osu.Game/Rulesets/Mods/Mod.cs

70 lines
1.9 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
using System;
2018-11-28 12:12:29 +08:00
using Newtonsoft.Json;
using osu.Game.IO.Serialization;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// The base class for gameplay modifiers.
/// </summary>
public abstract class Mod : IMod, IJsonSerializable
2018-04-13 17:19:50 +08:00
{
/// <summary>
/// The name of this mod.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public abstract string Name { get; }
/// <summary>
/// The shortened name of this mod.
/// </summary>
public abstract string Acronym { get; }
2018-04-13 17:19:50 +08:00
/// <summary>
/// The icon of this mod.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public virtual FontAwesome Icon => FontAwesome.fa_question;
/// <summary>
/// The type of this mod.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
public virtual ModType Type => ModType.Fun;
2018-04-13 17:19:50 +08:00
/// <summary>
/// The user readable description of this mod.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public virtual string Description => string.Empty;
/// <summary>
/// The score multiplier of this mod.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public abstract double ScoreMultiplier { get; }
/// <summary>
/// Returns true if this mod is implemented (and playable).
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public virtual bool HasImplementation => this is IApplicableMod;
/// <summary>
/// Returns if this mod is ranked.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public virtual bool Ranked => false;
/// <summary>
/// The mods this mod cannot be enabled with.
/// </summary>
2018-11-28 12:12:29 +08:00
[JsonIgnore]
2018-04-13 17:19:50 +08:00
public virtual Type[] IncompatibleMods => new Type[] { };
}
}