-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update favourite statistic value on favourite button clicks
- Loading branch information
Showing
5 changed files
with
106 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
osu.Game/Beatmaps/Drawables/Cards/BeatmapSetFavouriteState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Beatmaps.Drawables.Cards.Buttons; | ||
using osu.Game.Beatmaps.Drawables.Cards.Statistics; | ||
|
||
namespace osu.Game.Beatmaps.Drawables.Cards | ||
{ | ||
/// <summary> | ||
/// Stores the current favourite state of a beatmap set. | ||
/// Used to coordinate between <see cref="FavouriteButton"/> and <see cref="FavouritesStatistic"/>. | ||
/// </summary> | ||
public readonly struct BeatmapSetFavouriteState | ||
{ | ||
/// <summary> | ||
/// Whether the currently logged-in user has favourited this beatmap. | ||
/// </summary> | ||
public bool Favourited { get; } | ||
|
||
/// <summary> | ||
/// The number of favourites that the beatmap set has received, including the currently logged-in user. | ||
/// </summary> | ||
public int FavouriteCount { get; } | ||
|
||
public BeatmapSetFavouriteState(bool favourited, int favouriteCount) | ||
{ | ||
Favourited = favourited; | ||
FavouriteCount = favouriteCount; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters