A game framework written with osu! in mind.
at master 1.4 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using osu.Framework.Allocation; 5using osu.Framework.Graphics.Performance; 6using osu.Framework.Statistics; 7 8namespace osu.Framework.Tests.Visual.Testing 9{ 10 public class TestSceneGlobalStatisticsDisplay : FrameworkTestScene 11 { 12 private GlobalStatisticsDisplay display; 13 14 [BackgroundDependencyLoader] 15 private void load() 16 { 17 Children = new[] 18 { 19 display = new GlobalStatisticsDisplay(), 20 }; 21 22 display.ToggleVisibility(); 23 24 GlobalStatistic<double> stat = null; 25 26 AddStep("Register test statistic", () => stat = GlobalStatistics.Get<double>("TestCase", "Test Statistic")); 27 28 AddStep("Change value once", () => stat.Value = 10); 29 AddStep("Change value again", () => stat.Value = 20); 30 31 AddStep("Register statistics non-alphabetically", () => 32 { 33 GlobalStatistics.Get<int>("ZZZZZ", "BBBBB"); 34 GlobalStatistics.Get<int>("ZZZZZ", "AAAAA"); 35 }); 36 37 AddStep("Register groups non-alphabetically", () => 38 { 39 GlobalStatistics.Get<int>("XXXXX", "BBBBB"); 40 GlobalStatistics.Get<int>("TTTTT", "AAAAA"); 41 }); 42 } 43 } 44}