2019-05-06 02:07:55 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps ;
using osu.Game.Graphics ;
2020-12-25 12:38:11 +08:00
using osu.Game.Online.Rooms ;
2020-01-03 23:22:33 +08:00
using osu.Game.Rulesets ;
2023-02-06 20:44:00 +08:00
using osu.Game.Scoring ;
2019-05-06 02:07:55 +08:00
using osuTK.Graphics ;
namespace osu.Game.Users
{
public abstract class UserActivity
{
2023-02-07 05:30:55 +08:00
public abstract string GetStatus ( bool hideIdentifiableInformation = false ) ;
2023-02-06 20:44:00 +08:00
2019-05-06 02:07:55 +08:00
public virtual Color4 GetAppropriateColour ( OsuColour colours ) = > colours . GreenDarker ;
2023-02-13 05:11:55 +08:00
public class ModdingBeatmap : EditingBeatmap
2019-05-12 23:38:02 +08:00
{
2023-02-13 04:32:17 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > "Modding a beatmap" ;
2019-05-12 23:38:02 +08:00
public override Color4 GetAppropriateColour ( OsuColour colours ) = > colours . PurpleDark ;
2023-02-13 05:11:55 +08:00
public ModdingBeatmap ( IBeatmapInfo info )
: base ( info )
{
}
2019-05-12 23:38:02 +08:00
}
2019-05-06 02:07:55 +08:00
2019-06-12 01:41:48 +08:00
public class ChoosingBeatmap : UserActivity
2019-05-12 23:38:02 +08:00
{
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > "Choosing a beatmap" ;
2019-05-12 23:38:02 +08:00
}
2019-05-06 02:07:55 +08:00
2021-08-18 08:13:53 +08:00
public abstract class InGame : UserActivity
2019-05-06 02:07:55 +08:00
{
2021-11-15 17:46:11 +08:00
public IBeatmapInfo BeatmapInfo { get ; }
2021-08-16 06:32:33 +08:00
2021-12-03 17:14:44 +08:00
public IRulesetInfo Ruleset { get ; }
2021-08-16 06:32:33 +08:00
2021-12-03 17:14:44 +08:00
protected InGame ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
2021-08-16 06:32:33 +08:00
{
2021-10-02 23:55:29 +08:00
BeatmapInfo = beatmapInfo ;
2021-08-16 06:32:33 +08:00
Ruleset = ruleset ;
}
2021-08-16 07:06:23 +08:00
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > Ruleset . CreateInstance ( ) . PlayingVerb ;
2021-08-16 06:32:33 +08:00
}
public class InMultiplayerGame : InGame
{
2021-12-03 17:14:44 +08:00
public InMultiplayerGame ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
2021-10-02 23:55:29 +08:00
: base ( beatmapInfo , ruleset )
2021-08-14 13:20:36 +08:00
{
}
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > $@"{base.GetStatus(hideIdentifiableInformation)} with others" ;
2019-05-06 02:07:55 +08:00
}
2022-02-25 15:03:46 +08:00
public class SpectatingMultiplayerGame : InGame
{
public SpectatingMultiplayerGame ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
: base ( beatmapInfo , ruleset )
{
}
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > $"Watching others {base.GetStatus(hideIdentifiableInformation).ToLowerInvariant()}" ;
2022-02-25 15:03:46 +08:00
}
2021-08-22 09:54:07 +08:00
public class InPlaylistGame : InGame
{
2021-12-03 17:14:44 +08:00
public InPlaylistGame ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
2021-10-02 23:55:29 +08:00
: base ( beatmapInfo , ruleset )
2021-08-22 09:54:07 +08:00
{
}
}
2021-08-16 06:32:33 +08:00
public class InSoloGame : InGame
2019-05-12 23:38:02 +08:00
{
2021-12-03 17:14:44 +08:00
public InSoloGame ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
2021-10-02 23:55:29 +08:00
: base ( beatmapInfo , ruleset )
2019-05-12 23:38:02 +08:00
{
}
2019-05-06 02:07:55 +08:00
}
2023-02-13 05:04:12 +08:00
public class TestingBeatmap : InGame
{
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > "Testing a beatmap" ;
public TestingBeatmap ( IBeatmapInfo beatmapInfo , IRulesetInfo ruleset )
: base ( beatmapInfo , ruleset )
{
}
}
2023-02-13 04:32:17 +08:00
public class EditingBeatmap : UserActivity
2019-05-12 23:38:02 +08:00
{
2021-11-15 17:46:11 +08:00
public IBeatmapInfo BeatmapInfo { get ; }
2019-06-12 15:33:15 +08:00
2023-02-13 04:32:17 +08:00
public EditingBeatmap ( IBeatmapInfo info )
2019-05-12 23:38:02 +08:00
{
2021-10-02 23:55:29 +08:00
BeatmapInfo = info ;
2019-05-12 23:38:02 +08:00
}
2019-05-06 02:07:55 +08:00
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > @"Editing a beatmap" ;
2019-05-12 23:38:02 +08:00
}
2019-05-06 02:07:55 +08:00
2023-02-13 04:32:17 +08:00
public class WatchingReplay : UserActivity
2019-05-12 23:38:02 +08:00
{
2023-02-06 20:44:00 +08:00
private readonly ScoreInfo score ;
2023-02-07 04:07:16 +08:00
protected string Username = > score . User . Username ;
2023-02-06 20:44:00 +08:00
2023-07-04 13:50:34 +08:00
public BeatmapInfo ? BeatmapInfo = > score . BeatmapInfo ;
2023-02-06 20:44:00 +08:00
2023-02-13 04:32:17 +08:00
public WatchingReplay ( ScoreInfo score )
2023-02-06 20:44:00 +08:00
{
this . score = score ;
}
2023-02-10 01:15:30 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > hideIdentifiableInformation ? @"Watching a replay" : $@"Watching {Username}'s replay" ;
2023-02-06 08:41:10 +08:00
}
2023-02-06 07:58:08 +08:00
2023-02-13 04:32:17 +08:00
public class SpectatingUser : WatchingReplay
2023-02-06 08:41:10 +08:00
{
2023-02-10 01:15:30 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > hideIdentifiableInformation ? @"Spectating a user" : $@"Spectating {Username}" ;
2023-02-06 20:44:00 +08:00
2023-02-13 04:32:17 +08:00
public SpectatingUser ( ScoreInfo score )
2023-02-06 20:44:00 +08:00
: base ( score )
{
}
2019-05-12 23:38:02 +08:00
}
2020-11-08 20:21:21 +08:00
public class SearchingForLobby : UserActivity
{
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > @"Looking for a lobby" ;
2020-11-08 20:21:21 +08:00
}
2019-06-12 01:41:48 +08:00
public class InLobby : UserActivity
2019-05-12 23:38:02 +08:00
{
2023-02-07 05:30:55 +08:00
public override string GetStatus ( bool hideIdentifiableInformation = false ) = > @"In a lobby" ;
2020-11-08 20:21:21 +08:00
public readonly Room Room ;
public InLobby ( Room room )
{
Room = room ;
}
2019-05-12 23:38:02 +08:00
}
2019-05-06 02:07:55 +08:00
}
}