mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Add seeding screen
This commit is contained in:
23
osu.Game.Tournament/Models/SeedingBeatmap.cs
Normal file
23
osu.Game.Tournament/Models/SeedingBeatmap.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// 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.Framework.Bindables;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Tournament.Models
|
||||
{
|
||||
public class SeedingBeatmap
|
||||
{
|
||||
public int ID;
|
||||
|
||||
public BeatmapInfo BeatmapInfo;
|
||||
|
||||
public long Score;
|
||||
|
||||
public Bindable<int> Seed = new BindableInt
|
||||
{
|
||||
MinValue = 1,
|
||||
MaxValue = 64
|
||||
};
|
||||
}
|
||||
}
|
21
osu.Game.Tournament/Models/SeedingResult.cs
Normal file
21
osu.Game.Tournament/Models/SeedingResult.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// 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 System.Collections.Generic;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Tournament.Models
|
||||
{
|
||||
public class SeedingResult
|
||||
{
|
||||
public List<SeedingBeatmap> Beatmaps = new List<SeedingBeatmap>();
|
||||
|
||||
public Bindable<string> Mod = new Bindable<string>();
|
||||
|
||||
public Bindable<int> Seed = new BindableInt
|
||||
{
|
||||
MinValue = 1,
|
||||
MaxValue = 64
|
||||
};
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Users;
|
||||
@ -29,6 +30,32 @@ namespace osu.Game.Tournament.Models
|
||||
/// </summary>
|
||||
public Bindable<string> Acronym = new Bindable<string>(string.Empty);
|
||||
|
||||
public BindableList<SeedingResult> SeedingResults = new BindableList<SeedingResult>();
|
||||
|
||||
public double AverageRank
|
||||
{
|
||||
get
|
||||
{
|
||||
var ranks = Players.Select(p => p.Statistics?.Ranks.Global)
|
||||
.Where(i => i.HasValue)
|
||||
.Select(i => i.Value)
|
||||
.ToArray();
|
||||
|
||||
if (ranks.Length == 0)
|
||||
return 0;
|
||||
|
||||
return ranks.Average();
|
||||
}
|
||||
}
|
||||
|
||||
public Bindable<string> Seed = new Bindable<string>(string.Empty);
|
||||
|
||||
public Bindable<int> LastYearPlacing = new BindableInt
|
||||
{
|
||||
MinValue = 1,
|
||||
MaxValue = 64
|
||||
};
|
||||
|
||||
[JsonProperty]
|
||||
public BindableList<User> Players { get; set; } = new BindableList<User>();
|
||||
|
||||
|
Reference in New Issue
Block a user