2019-05-13 16:24:33 +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.
|
|
|
|
|
2019-05-17 11:40:15 +08:00
|
|
|
using System;
|
2019-05-13 16:24:33 +08:00
|
|
|
using Newtonsoft.Json;
|
2019-05-17 17:09:11 +08:00
|
|
|
using osu.Framework.Graphics.Colour;
|
|
|
|
using osuTK.Graphics;
|
2019-05-13 16:24:33 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests.Responses
|
|
|
|
{
|
2019-05-17 11:40:15 +08:00
|
|
|
public class APIUpdateStream : IEquatable<APIUpdateStream>
|
2019-05-13 16:24:33 +08:00
|
|
|
{
|
|
|
|
[JsonProperty("id")]
|
|
|
|
public long Id { get; set; }
|
|
|
|
|
|
|
|
[JsonProperty("name")]
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
[JsonProperty("is_featured")]
|
|
|
|
public bool IsFeatured { get; set; }
|
|
|
|
|
|
|
|
[JsonProperty("display_name")]
|
|
|
|
public string DisplayName { get; set; }
|
|
|
|
|
|
|
|
[JsonProperty("latest_build")]
|
|
|
|
public APIChangelogBuild LatestBuild { get; set; }
|
2019-05-17 11:40:15 +08:00
|
|
|
|
2019-05-21 13:02:34 +08:00
|
|
|
public bool Equals(APIUpdateStream other) => Id == other?.Id;
|
2019-05-17 17:09:11 +08:00
|
|
|
|
|
|
|
public ColourInfo Colour
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
switch (Name)
|
|
|
|
{
|
|
|
|
case "stable40":
|
|
|
|
return new Color4(102, 204, 255, 255);
|
|
|
|
|
|
|
|
case "stable":
|
|
|
|
return new Color4(34, 153, 187, 255);
|
|
|
|
|
|
|
|
case "beta40":
|
|
|
|
return new Color4(255, 221, 85, 255);
|
|
|
|
|
|
|
|
case "cuttingedge":
|
|
|
|
return new Color4(238, 170, 0, 255);
|
|
|
|
|
2019-06-03 12:16:05 +08:00
|
|
|
case OsuGameBase.CLIENT_STREAM_NAME:
|
2019-05-17 17:09:11 +08:00
|
|
|
return new Color4(237, 18, 33, 255);
|
|
|
|
|
|
|
|
case "web":
|
|
|
|
return new Color4(136, 102, 238, 255);
|
|
|
|
|
|
|
|
default:
|
|
|
|
return new Color4(0, 0, 0, 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-13 16:24:33 +08:00
|
|
|
}
|
|
|
|
}
|