mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 17:47:18 +08:00
Rename EF classes to allow for shit to hit the fan
This commit is contained in:
parent
c383f26729
commit
0b6c4497bd
@ -6,7 +6,7 @@ using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public class BeatmapDifficulty : IHasPrimaryKey, IBeatmapDifficultyInfo
|
||||
public class EFBeatmapDifficulty : IHasPrimaryKey, IBeatmapDifficultyInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The default value used for all difficulty settings except <see cref="SliderMultiplier"/> and <see cref="SliderTickRate"/>.
|
||||
@ -23,11 +23,11 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
private float? approachRate;
|
||||
|
||||
public BeatmapDifficulty()
|
||||
public EFBeatmapDifficulty()
|
||||
{
|
||||
}
|
||||
|
||||
public BeatmapDifficulty(IBeatmapDifficultyInfo source)
|
||||
public EFBeatmapDifficulty(IBeatmapDifficultyInfo source)
|
||||
{
|
||||
CopyFrom(source);
|
||||
}
|
||||
@ -42,11 +42,11 @@ namespace osu.Game.Beatmaps
|
||||
public double SliderTickRate { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
|
||||
/// Returns a shallow-clone of this <see cref="EFBeatmapDifficulty"/>.
|
||||
/// </summary>
|
||||
public BeatmapDifficulty Clone()
|
||||
public EFBeatmapDifficulty Clone()
|
||||
{
|
||||
var diff = (BeatmapDifficulty)Activator.CreateInstance(GetType());
|
||||
var diff = (EFBeatmapDifficulty)Activator.CreateInstance(GetType());
|
||||
CopyTo(diff);
|
||||
return diff;
|
||||
}
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Beatmaps
|
||||
SliderTickRate = other.SliderTickRate;
|
||||
}
|
||||
|
||||
public virtual void CopyTo(BeatmapDifficulty other)
|
||||
public virtual void CopyTo(EFBeatmapDifficulty other)
|
||||
{
|
||||
other.ApproachRate = ApproachRate;
|
||||
other.DrainRate = DrainRate;
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
[ExcludeFromDynamicCompile]
|
||||
[Serializable]
|
||||
public class BeatmapInfo : IEquatable<BeatmapInfo>, IHasPrimaryKey, IBeatmapInfo
|
||||
public class EFBeatmapInfo : IEquatable<EFBeatmapInfo>, IHasPrimaryKey, IBeatmapInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
@ -40,14 +40,14 @@ namespace osu.Game.Beatmaps
|
||||
public BeatmapOnlineStatus Status { get; set; } = BeatmapOnlineStatus.None;
|
||||
|
||||
[Required]
|
||||
public BeatmapSetInfo BeatmapSet { get; set; }
|
||||
public EFBeatmapSetInfo BeatmapSet { get; set; }
|
||||
|
||||
public BeatmapMetadata Metadata { get; set; }
|
||||
public EFBeatmapMetadata Metadata { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int BaseDifficultyID { get; set; }
|
||||
|
||||
public BeatmapDifficulty BaseDifficulty { get; set; }
|
||||
public EFBeatmapDifficulty BaseDifficulty { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public APIBeatmap OnlineInfo { get; set; }
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public int RulesetID { get; set; }
|
||||
|
||||
public RulesetInfo Ruleset { get; set; }
|
||||
public EFRulesetInfo Ruleset { get; set; }
|
||||
|
||||
public bool LetterboxInBreaks { get; set; }
|
||||
public bool WidescreenStoryboard { get; set; }
|
||||
@ -131,7 +131,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public override string ToString() => this.GetDisplayTitle();
|
||||
|
||||
public bool Equals(BeatmapInfo other)
|
||||
public bool Equals(EFBeatmapInfo other)
|
||||
{
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
if (other == null) return false;
|
||||
@ -142,20 +142,20 @@ namespace osu.Game.Beatmaps
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Equals(IBeatmapInfo other) => other is BeatmapInfo b && Equals(b);
|
||||
public bool Equals(IBeatmapInfo other) => other is EFBeatmapInfo b && Equals(b);
|
||||
|
||||
public bool AudioEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
|
||||
BeatmapSet.Hash == other.BeatmapSet.Hash &&
|
||||
(Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile;
|
||||
public bool AudioEquals(EFBeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
|
||||
BeatmapSet.Hash == other.BeatmapSet.Hash &&
|
||||
(Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile;
|
||||
|
||||
public bool BackgroundEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
|
||||
BeatmapSet.Hash == other.BeatmapSet.Hash &&
|
||||
(Metadata ?? BeatmapSet.Metadata).BackgroundFile == (other.Metadata ?? other.BeatmapSet.Metadata).BackgroundFile;
|
||||
public bool BackgroundEquals(EFBeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
|
||||
BeatmapSet.Hash == other.BeatmapSet.Hash &&
|
||||
(Metadata ?? BeatmapSet.Metadata).BackgroundFile == (other.Metadata ?? other.BeatmapSet.Metadata).BackgroundFile;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a shallow-clone of this <see cref="BeatmapInfo"/>.
|
||||
/// Returns a shallow-clone of this <see cref="EFBeatmapInfo"/>.
|
||||
/// </summary>
|
||||
public BeatmapInfo Clone() => (BeatmapInfo)MemberwiseClone();
|
||||
public EFBeatmapInfo Clone() => (EFBeatmapInfo)MemberwiseClone();
|
||||
|
||||
#region Implementation of IHasOnlineID
|
||||
|
||||
@ -166,7 +166,7 @@ namespace osu.Game.Beatmaps
|
||||
#region Implementation of IBeatmapInfo
|
||||
|
||||
[JsonIgnore]
|
||||
IBeatmapMetadataInfo IBeatmapInfo.Metadata => Metadata ?? BeatmapSet?.Metadata ?? new BeatmapMetadata();
|
||||
IBeatmapMetadataInfo IBeatmapInfo.Metadata => Metadata ?? BeatmapSet?.Metadata ?? new EFBeatmapMetadata();
|
||||
|
||||
[JsonIgnore]
|
||||
IBeatmapDifficultyInfo IBeatmapInfo.Difficulty => BaseDifficulty;
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
[ExcludeFromDynamicCompile]
|
||||
[Serializable]
|
||||
public class BeatmapMetadata : IEquatable<BeatmapMetadata>, IHasPrimaryKey, IBeatmapMetadataInfo
|
||||
public class EFBeatmapMetadata : IEquatable<EFBeatmapMetadata>, IHasPrimaryKey, IBeatmapMetadataInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
@ -33,10 +33,10 @@ namespace osu.Game.Beatmaps
|
||||
public string ArtistUnicode { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public List<BeatmapInfo> Beatmaps { get; set; } = new List<BeatmapInfo>();
|
||||
public List<EFBeatmapInfo> Beatmaps { get; set; } = new List<EFBeatmapInfo>();
|
||||
|
||||
[JsonIgnore]
|
||||
public List<BeatmapSetInfo> BeatmapSets { get; set; } = new List<BeatmapSetInfo>();
|
||||
public List<EFBeatmapSetInfo> BeatmapSets { get; set; } = new List<EFBeatmapSetInfo>();
|
||||
|
||||
/// <summary>
|
||||
/// The author of the beatmaps in this set.
|
||||
@ -81,7 +81,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public string BackgroundFile { get; set; } = string.Empty;
|
||||
|
||||
public bool Equals(BeatmapMetadata other) => ((IBeatmapMetadataInfo)this).Equals(other);
|
||||
public bool Equals(EFBeatmapMetadata other) => ((IBeatmapMetadataInfo)this).Equals(other);
|
||||
|
||||
public override string ToString() => this.GetDisplayTitle();
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Extensions;
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
[ExcludeFromDynamicCompile]
|
||||
public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete, IEquatable<BeatmapSetInfo>, IBeatmapSetInfo
|
||||
public class EFBeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete, IEquatable<EFBeatmapSetInfo>, IBeatmapSetInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public DateTimeOffset DateAdded { get; set; }
|
||||
|
||||
public BeatmapMetadata Metadata { get; set; }
|
||||
public EFBeatmapMetadata Metadata { get; set; }
|
||||
|
||||
[NotNull]
|
||||
public List<BeatmapInfo> Beatmaps { get; } = new List<BeatmapInfo>();
|
||||
@ -74,7 +74,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public bool Protected { get; set; }
|
||||
|
||||
public bool Equals(BeatmapSetInfo other)
|
||||
public bool Equals(EFBeatmapSetInfo other)
|
||||
{
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
if (other == null) return false;
|
||||
@ -85,7 +85,7 @@ namespace osu.Game.Beatmaps
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Equals(IBeatmapSetInfo other) => other is BeatmapSetInfo b && Equals(b);
|
||||
public bool Equals(IBeatmapSetInfo other) => other is EFBeatmapSetInfo b && Equals(b);
|
||||
|
||||
#region Implementation of IHasOnlineID
|
||||
|
@ -19,12 +19,12 @@ namespace osu.Game.Database
|
||||
{
|
||||
public class OsuDbContext : DbContext
|
||||
{
|
||||
public DbSet<BeatmapInfo> BeatmapInfo { get; set; }
|
||||
public DbSet<BeatmapDifficulty> BeatmapDifficulty { get; set; }
|
||||
public DbSet<BeatmapMetadata> BeatmapMetadata { get; set; }
|
||||
public DbSet<BeatmapSetInfo> BeatmapSetInfo { get; set; }
|
||||
public DbSet<EFBeatmapInfo> EFBeatmapInfo { get; set; }
|
||||
public DbSet<EFBeatmapDifficulty> BeatmapDifficulty { get; set; }
|
||||
public DbSet<EFBeatmapMetadata> BeatmapMetadata { get; set; }
|
||||
public DbSet<EFBeatmapSetInfo> EFBeatmapSetInfo { get; set; }
|
||||
public DbSet<FileInfo> FileInfo { get; set; }
|
||||
public DbSet<RulesetInfo> RulesetInfo { get; set; }
|
||||
public DbSet<EFRulesetInfo> RulesetInfo { get; set; }
|
||||
public DbSet<EFSkinInfo> SkinInfo { get; set; }
|
||||
public DbSet<ScoreInfo> ScoreInfo { get; set; }
|
||||
|
||||
@ -125,13 +125,13 @@ namespace osu.Game.Database
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.OnlineID).IsUnique();
|
||||
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.MD5Hash);
|
||||
modelBuilder.Entity<BeatmapInfo>().HasIndex(b => b.Hash);
|
||||
modelBuilder.Entity<EFBeatmapInfo>().HasIndex(b => b.OnlineID).IsUnique();
|
||||
modelBuilder.Entity<EFBeatmapInfo>().HasIndex(b => b.MD5Hash);
|
||||
modelBuilder.Entity<EFBeatmapInfo>().HasIndex(b => b.Hash);
|
||||
|
||||
modelBuilder.Entity<BeatmapSetInfo>().HasIndex(b => b.OnlineID).IsUnique();
|
||||
modelBuilder.Entity<BeatmapSetInfo>().HasIndex(b => b.DeletePending);
|
||||
modelBuilder.Entity<BeatmapSetInfo>().HasIndex(b => b.Hash).IsUnique();
|
||||
modelBuilder.Entity<EFBeatmapSetInfo>().HasIndex(b => b.OnlineID).IsUnique();
|
||||
modelBuilder.Entity<EFBeatmapSetInfo>().HasIndex(b => b.DeletePending);
|
||||
modelBuilder.Entity<EFBeatmapSetInfo>().HasIndex(b => b.Hash).IsUnique();
|
||||
|
||||
modelBuilder.Entity<EFSkinInfo>().HasIndex(b => b.Hash).IsUnique();
|
||||
modelBuilder.Entity<EFSkinInfo>().HasIndex(b => b.DeletePending);
|
||||
@ -142,10 +142,10 @@ namespace osu.Game.Database
|
||||
modelBuilder.Entity<FileInfo>().HasIndex(b => b.Hash).IsUnique();
|
||||
modelBuilder.Entity<FileInfo>().HasIndex(b => b.ReferenceCount);
|
||||
|
||||
modelBuilder.Entity<RulesetInfo>().HasIndex(b => b.Available);
|
||||
modelBuilder.Entity<RulesetInfo>().HasIndex(b => b.ShortName).IsUnique();
|
||||
modelBuilder.Entity<EFRulesetInfo>().HasIndex(b => b.Available);
|
||||
modelBuilder.Entity<EFRulesetInfo>().HasIndex(b => b.ShortName).IsUnique();
|
||||
|
||||
modelBuilder.Entity<BeatmapInfo>().HasOne(b => b.BaseDifficulty);
|
||||
modelBuilder.Entity<EFBeatmapInfo>().HasOne(b => b.BaseDifficulty);
|
||||
|
||||
modelBuilder.Entity<ScoreInfo>().HasIndex(b => b.OnlineID).IsUnique();
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ using osu.Framework.Testing;
|
||||
namespace osu.Game.Rulesets
|
||||
{
|
||||
[ExcludeFromDynamicCompile]
|
||||
public sealed class RulesetInfo : IEquatable<RulesetInfo>, IRulesetInfo
|
||||
public sealed class EFRulesetInfo : IEquatable<EFRulesetInfo>, IRulesetInfo
|
||||
{
|
||||
public int? ID { get; set; }
|
||||
|
||||
@ -45,9 +45,9 @@ namespace osu.Game.Rulesets
|
||||
return ruleset;
|
||||
}
|
||||
|
||||
public bool Equals(RulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
||||
public bool Equals(EFRulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
||||
|
||||
public override bool Equals(object obj) => obj is RulesetInfo rulesetInfo && Equals(rulesetInfo);
|
||||
public override bool Equals(object obj) => obj is EFRulesetInfo rulesetInfo && Equals(rulesetInfo);
|
||||
|
||||
public bool Equals(IRulesetInfo other) => other is RulesetInfo b && Equals(b);
|
||||
|
@ -789,7 +789,7 @@ See the LICENCE file in the repository root for full licence text.
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFBeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
|
Loading…
x
Reference in New Issue
Block a user