1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Use typeparamref.

This commit is contained in:
Huo Yaoyuan 2019-11-17 20:48:23 +08:00
parent 5727963f86
commit f05b83d7d4
10 changed files with 33 additions and 33 deletions

View File

@ -93,7 +93,7 @@ namespace osu.Game.Beatmaps.Formats
/// <summary> /// <summary>
/// Registers a fallback decoder instantiation function. /// Registers a fallback decoder instantiation function.
/// The fallback will be returned if the first non-empty line of the decoded stream does not match any known magic. /// The fallback will be returned if the first non-empty line of the decoded stream does not match any known magic.
/// Calling this method will overwrite any existing global fallback registration for type <see cref="T"/> - use with caution. /// Calling this method will overwrite any existing global fallback registration for type <typeparamref name="T"/> - use with caution.
/// </summary> /// </summary>
/// <typeparam name="T">Type of object being decoded.</typeparam> /// <typeparam name="T">Type of object being decoded.</typeparam>
/// <param name="constructor">A function that constructs the fallback<see cref="Decoder"/>.</param> /// <param name="constructor">A function that constructs the fallback<see cref="Decoder"/>.</param>

View File

@ -54,13 +54,13 @@ namespace osu.Game.Database
public Action<Notification> PostNotification { protected get; set; } public Action<Notification> PostNotification { protected get; set; }
/// <summary> /// <summary>
/// Fired when a new <see cref="TModel"/> becomes available in the database. /// Fired when a new <typeparamref name="TModel"/> becomes available in the database.
/// This is not guaranteed to run on the update thread. /// This is not guaranteed to run on the update thread.
/// </summary> /// </summary>
public event Action<TModel> ItemAdded; public event Action<TModel> ItemAdded;
/// <summary> /// <summary>
/// Fired when a <see cref="TModel"/> is removed from the database. /// Fired when a <typeparamref name="TModel"/> is removed from the database.
/// This is not guaranteed to run on the update thread. /// This is not guaranteed to run on the update thread.
/// </summary> /// </summary>
public event Action<TModel> ItemRemoved; public event Action<TModel> ItemRemoved;
@ -95,7 +95,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Import one or more <see cref="TModel"/> items from filesystem <paramref name="paths"/>. /// Import one or more <typeparamref name="TModel"/> items from filesystem <paramref name="paths"/>.
/// This will post notifications tracking progress. /// This will post notifications tracking progress.
/// </summary> /// </summary>
/// <param name="paths">One or more archive locations on disk.</param> /// <param name="paths">One or more archive locations on disk.</param>
@ -173,7 +173,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Import one <see cref="TModel"/> from the filesystem and delete the file on success. /// Import one <typeparamref name="TModel"/> from the filesystem and delete the file on success.
/// </summary> /// </summary>
/// <param name="path">The archive location on disk.</param> /// <param name="path">The archive location on disk.</param>
/// <param name="cancellationToken">An optional cancellation token.</param> /// <param name="cancellationToken">An optional cancellation token.</param>
@ -275,7 +275,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Import an item from a <see cref="TModel"/>. /// Import an item from a <typeparamref name="TModel"/>.
/// </summary> /// </summary>
/// <param name="item">The model to be imported.</param> /// <param name="item">The model to be imported.</param>
/// <param name="archive">An optional archive to use for model population.</param> /// <param name="archive">An optional archive to use for model population.</param>
@ -589,7 +589,7 @@ namespace osu.Game.Database
protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash); protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);
/// <summary> /// <summary>
/// After an existing <see cref="TModel"/> is found during an import process, the default behaviour is to restore the existing /// After an existing <typeparamref name="TModel"/> is found during an import process, the default behaviour is to restore the existing
/// item and skip the import. This method allows changing that behaviour. /// item and skip the import. This method allows changing that behaviour.
/// </summary> /// </summary>
/// <param name="existing">The existing model.</param> /// <param name="existing">The existing model.</param>

View File

@ -41,17 +41,17 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Creates the download request for this <see cref="TModel"/>. /// Creates the download request for this <typeparamref name="TModel"/>.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> to be downloaded.</param> /// <param name="model">The <typeparamref name="TModel"/> to be downloaded.</param>
/// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.</param> /// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.</param>
/// <returns>The request object.</returns> /// <returns>The request object.</returns>
protected abstract ArchiveDownloadRequest<TModel> CreateDownloadRequest(TModel model, bool minimiseDownloadSize); protected abstract ArchiveDownloadRequest<TModel> CreateDownloadRequest(TModel model, bool minimiseDownloadSize);
/// <summary> /// <summary>
/// Begin a download for the requested <see cref="TModel"/>. /// Begin a download for the requested <typeparamref name="TModel"/>.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> to be downloaded.</param> /// <param name="model">The <typeparamref name="TModel"/> to be downloaded.</param>
/// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.</param> /// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.</param>
/// <returns>Whether the download was started.</returns> /// <returns>Whether the download was started.</returns>
public bool Download(TModel model, bool minimiseDownloadSize = false) public bool Download(TModel model, bool minimiseDownloadSize = false)
@ -131,9 +131,9 @@ namespace osu.Game.Database
/// <summary> /// <summary>
/// Performs implementation specific comparisons to determine whether a given model is present in the local store. /// Performs implementation specific comparisons to determine whether a given model is present in the local store.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> whose existence needs to be checked.</param> /// <param name="model">The <typeparamref name="TModel"/> whose existence needs to be checked.</param>
/// <param name="items">The usable items present in the store.</param> /// <param name="items">The usable items present in the store.</param>
/// <returns>Whether the <see cref="TModel"/> exists.</returns> /// <returns>Whether the <typeparamref name="TModel"/> exists.</returns>
protected abstract bool CheckLocalAvailability(TModel model, IQueryable<TModel> items); protected abstract bool CheckLocalAvailability(TModel model, IQueryable<TModel> items);
public ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model) => currentDownloads.Find(r => r.Model.Equals(model)); public ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model) => currentDownloads.Find(r => r.Model.Equals(model));

View File

@ -14,34 +14,34 @@ namespace osu.Game.Database
where TModel : class where TModel : class
{ {
/// <summary> /// <summary>
/// Fired when a <see cref="TModel"/> download begins. /// Fired when a <typeparamref name="TModel"/> download begins.
/// </summary> /// </summary>
event Action<ArchiveDownloadRequest<TModel>> DownloadBegan; event Action<ArchiveDownloadRequest<TModel>> DownloadBegan;
/// <summary> /// <summary>
/// Fired when a <see cref="TModel"/> download is interrupted, either due to user cancellation or failure. /// Fired when a <typeparamref name="TModel"/> download is interrupted, either due to user cancellation or failure.
/// </summary> /// </summary>
event Action<ArchiveDownloadRequest<TModel>> DownloadFailed; event Action<ArchiveDownloadRequest<TModel>> DownloadFailed;
/// <summary> /// <summary>
/// Checks whether a given <see cref="TModel"/> is already available in the local store. /// Checks whether a given <typeparamref name="TModel"/> is already available in the local store.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> whose existence needs to be checked.</param> /// <param name="model">The <typeparamref name="TModel"/> whose existence needs to be checked.</param>
/// <returns>Whether the <see cref="TModel"/> exists.</returns> /// <returns>Whether the <typeparamref name="TModel"/> exists.</returns>
bool IsAvailableLocally(TModel model); bool IsAvailableLocally(TModel model);
/// <summary> /// <summary>
/// Begin a download for the requested <see cref="TModel"/>. /// Begin a download for the requested <typeparamref name="TModel"/>.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> to be downloaded.</param> /// <param name="model">The <stypeparamref name="TModel"/> to be downloaded.</param>
/// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle..</param> /// <param name="minimiseDownloadSize">Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle..</param>
/// <returns>Whether the download was started.</returns> /// <returns>Whether the download was started.</returns>
bool Download(TModel model, bool minimiseDownloadSize); bool Download(TModel model, bool minimiseDownloadSize);
/// <summary> /// <summary>
/// Gets an existing <see cref="TModel"/> download request if it exists. /// Gets an existing <typeparamref name="TModel"/> download request if it exists.
/// </summary> /// </summary>
/// <param name="model">The <see cref="TModel"/> whose request is wanted.</param> /// <param name="model">The <typeparamref name="TModel"/> whose request is wanted.</param>
/// <returns>The <see cref="ArchiveDownloadRequest{TModel}"/> object if it exists, otherwise null.</returns> /// <returns>The <see cref="ArchiveDownloadRequest{TModel}"/> object if it exists, otherwise null.</returns>
ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model); ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model);
} }

View File

@ -6,7 +6,7 @@ using System;
namespace osu.Game.Database namespace osu.Game.Database
{ {
/// <summary> /// <summary>
/// Represents a model manager that publishes events when <see cref="TModel"/>s are added or removed. /// Represents a model manager that publishes events when <typeparamref name="TModel"/>s are added or removed.
/// </summary> /// </summary>
/// <typeparam name="TModel">The model type.</typeparam> /// <typeparam name="TModel">The model type.</typeparam>
public interface IModelManager<out TModel> public interface IModelManager<out TModel>

View File

@ -30,7 +30,7 @@ namespace osu.Game.Database
public IQueryable<T> ConsumableItems => AddIncludesForConsumption(ContextFactory.Get().Set<T>()); public IQueryable<T> ConsumableItems => AddIncludesForConsumption(ContextFactory.Get().Set<T>());
/// <summary> /// <summary>
/// Add a <see cref="T"/> to the database. /// Add a <typeparamref name="T"/> to the database.
/// </summary> /// </summary>
/// <param name="item">The item to add.</param> /// <param name="item">The item to add.</param>
public void Add(T item) public void Add(T item)
@ -45,7 +45,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Update a <see cref="T"/> in the database. /// Update a <typeparamref name="T"/> in the database.
/// </summary> /// </summary>
/// <param name="item">The item to update.</param> /// <param name="item">The item to update.</param>
public void Update(T item) public void Update(T item)
@ -58,7 +58,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Delete a <see cref="T"/> from the database. /// Delete a <typeparamref name="T"/> from the database.
/// </summary> /// </summary>
/// <param name="item">The item to delete.</param> /// <param name="item">The item to delete.</param>
public bool Delete(T item) public bool Delete(T item)
@ -77,7 +77,7 @@ namespace osu.Game.Database
} }
/// <summary> /// <summary>
/// Restore a <see cref="T"/> from a deleted state. /// Restore a <typeparamref name="T"/> from a deleted state.
/// </summary> /// </summary>
/// <param name="item">The item to undelete.</param> /// <param name="item">The item to undelete.</param>
public bool Undelete(T item) public bool Undelete(T item)

View File

@ -32,7 +32,7 @@ namespace osu.Game.Graphics.UserInterface
protected virtual float StripHeight() => 1; protected virtual float StripHeight() => 1;
/// <summary> /// <summary>
/// Whether entries should be automatically populated if <see cref="T"/> is an <see cref="Enum"/> type. /// Whether entries should be automatically populated if <typeparamref name="T"/> is an <see cref="Enum"/> type.
/// </summary> /// </summary>
protected virtual bool AddEnumEntriesAutomatically => true; protected virtual bool AddEnumEntriesAutomatically => true;

View File

@ -30,7 +30,7 @@ namespace osu.Game.Input.Bindings
/// </summary> /// </summary>
/// <param name="ruleset">A reference to identify the current <see cref="Ruleset"/>. Used to lookup mappings. Null for global mappings.</param> /// <param name="ruleset">A reference to identify the current <see cref="Ruleset"/>. Used to lookup mappings. Null for global mappings.</param>
/// <param name="variant">An optional variant for the specified <see cref="Ruleset"/>. Used when a ruleset has more than one possible keyboard layouts.</param> /// <param name="variant">An optional variant for the specified <see cref="Ruleset"/>. Used when a ruleset has more than one possible keyboard layouts.</param>
/// <param name="simultaneousMode">Specify how to deal with multiple matches of <see cref="KeyCombination"/>s and <see cref="T"/>s.</param> /// <param name="simultaneousMode">Specify how to deal with multiple matches of <see cref="KeyCombination"/>s and <typeparamref name="T"/>s.</param>
public DatabasedKeyBindingContainer(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None) public DatabasedKeyBindingContainer(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None)
: base(simultaneousMode) : base(simultaneousMode)
{ {

View File

@ -11,7 +11,7 @@ using osu.Game.Online.API;
namespace osu.Game.Online namespace osu.Game.Online
{ {
/// <summary> /// <summary>
/// A component which tracks a <see cref="TModel"/> through potential download/import/deletion. /// A component which tracks a <typeparamref name="TModel"/> through potential download/import/deletion.
/// </summary> /// </summary>
public abstract class DownloadTrackingComposite<TModel, TModelManager> : CompositeDrawable public abstract class DownloadTrackingComposite<TModel, TModelManager> : CompositeDrawable
where TModel : class, IEquatable<TModel> where TModel : class, IEquatable<TModel>
@ -22,7 +22,7 @@ namespace osu.Game.Online
private TModelManager manager; private TModelManager manager;
/// <summary> /// <summary>
/// Holds the current download state of the <see cref="TModel"/>, whether is has already been downloaded, is in progress, or is not downloaded. /// Holds the current download state of the <typeparamref name="TModel"/>, whether is has already been downloaded, is in progress, or is not downloaded.
/// </summary> /// </summary>
protected readonly Bindable<DownloadState> State = new Bindable<DownloadState>(); protected readonly Bindable<DownloadState> State = new Bindable<DownloadState>();

View File

@ -246,9 +246,9 @@ namespace osu.Game.Rulesets.UI
} }
/// <summary> /// <summary>
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>. /// Creates and adds the visual representation of a <typeparamref name="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.
/// </summary> /// </summary>
/// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param> /// <param name="hitObject">The <typeparamref name="TObject"/> to add the visual representation for.</param>
private void addHitObject(TObject hitObject) private void addHitObject(TObject hitObject)
{ {
var drawableObject = CreateDrawableRepresentation(hitObject); var drawableObject = CreateDrawableRepresentation(hitObject);