// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using Newtonsoft.Json; using osu.Framework.Graphics.Sprites; using osu.Game.IO.Serialization; namespace osu.Game.Rulesets.Mods { /// /// The base class for gameplay modifiers. /// public abstract class Mod : IMod, IJsonSerializable { /// /// The name of this mod. /// [JsonIgnore] public abstract string Name { get; } /// /// The shortened name of this mod. /// public abstract string Acronym { get; } /// /// The icon of this mod. /// [JsonIgnore] public virtual IconUsage Icon => FontAwesome.Solid.Question; /// /// The type of this mod. /// [JsonIgnore] public virtual ModType Type => ModType.Fun; /// /// The user readable description of this mod. /// [JsonIgnore] public virtual string Description => string.Empty; /// /// The score multiplier of this mod. /// [JsonIgnore] public abstract double ScoreMultiplier { get; } /// /// Returns true if this mod is implemented (and playable). /// [JsonIgnore] public virtual bool HasImplementation => this is IApplicableMod; /// /// Returns if this mod is ranked. /// [JsonIgnore] public virtual bool Ranked => false; /// /// The mods this mod cannot be enabled with. /// [JsonIgnore] public virtual Type[] IncompatibleMods => new Type[] { }; /// /// Creates a copy of this initialised to a default state. /// public virtual Mod CreateCopy() => (Mod)Activator.CreateInstance(GetType()); public bool Equals(IMod other) => GetType() == other?.GetType(); } }