1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 06:17:44 +08:00
osu-lazer/osu.Game/Overlays/Profile/Sections/RanksSection.cs

82 lines
2.5 KiB
C#
Raw Normal View History

2017-06-07 22:49:14 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-07-27 00:55:37 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Profile.Sections.Ranks;
2017-07-29 06:31:52 +08:00
using osu.Game.Rulesets.Scoring;
2017-07-27 00:55:37 +08:00
using System;
using System.Collections.Generic;
2017-07-13 12:53:45 +08:00
namespace osu.Game.Overlays.Profile.Sections
2017-06-07 22:49:14 +08:00
{
public class RanksSection : ProfileSection
{
public override string Title => "Ranks";
2017-06-15 23:47:34 +08:00
public override string Identifier => "top_ranks";
2017-07-27 00:55:37 +08:00
2017-07-29 06:31:52 +08:00
private readonly FillFlowContainer<DrawableScore> best, firstPlace;
2017-07-27 00:55:37 +08:00
public RanksSection()
{
Children = new Drawable[]
{
new OsuSpriteText {
TextSize = 15,
Text = "Best Performance",
Font = "Exo2.0-RegularItalic",
},
2017-07-29 06:31:52 +08:00
best = new FillFlowContainer<DrawableScore>
2017-07-27 00:55:37 +08:00
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
},
new OsuSpriteText {
TextSize = 15,
Text = "First Place Ranks",
Font = "Exo2.0-RegularItalic",
},
2017-07-29 06:31:52 +08:00
firstPlace = new FillFlowContainer<DrawableScore>
2017-07-27 00:55:37 +08:00
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
},
};
}
2017-07-29 06:31:52 +08:00
public IEnumerable<Score> BestScores
2017-07-27 00:55:37 +08:00
{
set
{
int i = 0;
2017-07-29 06:31:52 +08:00
foreach (Score score in value)
2017-07-27 00:55:37 +08:00
{
2017-07-29 06:31:52 +08:00
best.Add(new DrawableScore(score, Math.Pow(0.95, i))
2017-07-27 00:55:37 +08:00
{
RelativeSizeAxes = Axes.X,
Height = 60,
});
i++;
}
}
}
2017-07-29 06:31:52 +08:00
public IEnumerable<Score> FirstPlaceScores
2017-07-27 00:55:37 +08:00
{
set
{
2017-07-29 06:31:52 +08:00
foreach (Score score in value)
firstPlace.Add(new DrawableScore(score)
2017-07-27 00:55:37 +08:00
{
RelativeSizeAxes = Axes.X,
Height = 60,
});
}
}
2017-06-07 22:49:14 +08:00
}
}