Add support for picks and bans

This commit is contained in:
Dean Herbert
2018-11-08 06:29:04 +09:00
parent e4a767d656
commit 5c84c3c0a8
8 changed files with 232 additions and 38 deletions

View File

@ -0,0 +1,24 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Tournament.Screens.Ladder.Components
{
public class BeatmapChoice
{
public TeamColour Team;
public ChoiceType Type;
public int BeatmapID;
}
public enum TeamColour
{
Red,
Blue
}
public enum ChoiceType
{
Pick,
Ban,
}
}

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using osu.Framework.Configuration;
using osu.Game.Tournament.Components;
@ -34,6 +35,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
public readonly Bindable<bool> Losers = new Bindable<bool>();
public readonly ObservableCollection<BeatmapChoice> PicksBans = new ObservableCollection<BeatmapChoice>();
[JsonIgnore]
public readonly Bindable<TournamentGrouping> Grouping = new Bindable<TournamentGrouping>();
@ -58,7 +61,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
Team2.BindValueChanged(t => Team2Acronym = t?.Acronym, true);
}
public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) : this()
public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null)
: this()
{
Team1.Value = team1;
Team2.Value = team2;