1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 12:07:25 +08:00
osu-lazer/osu.Game/Users/UserActivity.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
3.2 KiB
C#
Raw Normal View History

// 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;
using osuTK.Graphics;
namespace osu.Game.Users
{
public abstract class UserActivity
{
public abstract string Status { get; }
public virtual Color4 GetAppropriateColour(OsuColour colours) => colours.GreenDarker;
public class Modding : UserActivity
{
public override string Status => "Modding a map";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
}
public class ChoosingBeatmap : UserActivity
{
public override string Status => "Choosing a beatmap";
}
2021-08-18 08:13:53 +08:00
public abstract class InGame : UserActivity
{
public IBeatmapInfo BeatmapInfo { get; }
public IRulesetInfo Ruleset { get; }
protected InGame(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
{
2021-10-02 23:55:29 +08:00
BeatmapInfo = beatmapInfo;
Ruleset = ruleset;
}
2021-08-16 07:06:23 +08:00
public override string Status => Ruleset.CreateInstance().PlayingVerb;
}
public class InMultiplayerGame : InGame
{
public InMultiplayerGame(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
2021-10-02 23:55:29 +08:00
: base(beatmapInfo, ruleset)
{
}
2021-08-16 07:06:23 +08:00
public override string Status => $@"{base.Status} with others";
}
2022-02-25 15:03:46 +08:00
public class SpectatingMultiplayerGame : InGame
{
public SpectatingMultiplayerGame(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
: base(beatmapInfo, ruleset)
{
}
public override string Status => $"Watching others {base.Status.ToLowerInvariant()}";
}
public class InPlaylistGame : InGame
{
public InPlaylistGame(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
2021-10-02 23:55:29 +08:00
: base(beatmapInfo, ruleset)
{
}
}
public class InSoloGame : InGame
{
public InSoloGame(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
2021-10-02 23:55:29 +08:00
: base(beatmapInfo, ruleset)
{
}
}
public class Editing : UserActivity
{
public IBeatmapInfo BeatmapInfo { get; }
public Editing(IBeatmapInfo info)
{
2021-10-02 23:55:29 +08:00
BeatmapInfo = info;
}
public override string Status => @"Editing a beatmap";
}
public class Spectating : UserActivity
{
public override string Status => @"Spectating a game";
}
public class SearchingForLobby : UserActivity
{
public override string Status => @"Looking for a lobby";
}
public class InLobby : UserActivity
{
2021-08-14 22:39:12 +08:00
public override string Status => @"In a lobby";
public readonly Room Room;
public InLobby(Room room)
{
Room = room;
}
}
}
}