tangled
alpha
login
or
join now
keii.dev
/
osu-framework
A game framework written with osu! in mind.
0
fork
atom
overview
issues
pulls
pipelines
Use language primitive types.
Huo Yaoyuan
6 years ago
ee078e3e
43432f7c
+7
-11
4 changed files
expand all
collapse all
unified
split
.editorconfig
osu.Framework
Audio
Track
ITrackStore.cs
Input
States
ButtonStates.cs
osu.Framework.Tests
Visual
Input
TestSceneInputManager.cs
+2
-2
.editorconfig
···
112
112
#Roslyn language styles
113
113
114
114
#Style - type names
115
115
-
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
116
116
-
dotnet_style_predefined_type_for_member_access = true:silent
115
115
+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
116
116
+
dotnet_style_predefined_type_for_member_access = true:warning
117
117
csharp_style_var_when_type_is_apparent = true:none
118
118
csharp_style_var_for_built_in_types = true:none
119
119
csharp_style_var_elsewhere = true:silent
+3
-4
osu.Framework.Tests/Visual/Input/TestSceneInputManager.cs
···
1
1
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2
2
// See the LICENCE file in the repository root for full licence text.
3
3
4
4
-
using System;
5
4
using osu.Framework.Allocation;
6
5
using osu.Framework.Configuration;
7
6
using osu.Framework.Graphics;
···
112
111
var currentState = inputManager.CurrentState;
113
112
var mouse = currentState.Mouse;
114
113
inputManagerStatus.Text = $"{inputManager}";
115
115
-
mouseStatus.Text = $"Mouse: {mouse.Position} {mouse.Scroll} " + String.Join(" ", mouse.Buttons);
116
116
-
keyboardStatus.Text = "Keyboard: " + String.Join(" ", currentState.Keyboard.Keys);
117
117
-
joystickStatus.Text = "Joystick: " + String.Join(" ", currentState.Joystick.Buttons);
114
114
+
mouseStatus.Text = $"Mouse: {mouse.Position} {mouse.Scroll} " + string.Join(" ", mouse.Buttons);
115
115
+
keyboardStatus.Text = "Keyboard: " + string.Join(" ", currentState.Keyboard.Keys);
116
116
+
joystickStatus.Text = "Joystick: " + string.Join(" ", currentState.Joystick.Buttons);
118
117
base.Update();
119
118
}
120
119
+1
-3
osu.Framework/Audio/Track/ITrackStore.cs
···
1
1
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2
2
// See the LICENCE file in the repository root for full licence text.
3
3
4
4
-
using System;
5
5
-
6
4
namespace osu.Framework.Audio.Track
7
5
{
8
6
public interface ITrackStore : IAdjustableResourceStore<Track>
···
12
10
/// </summary>
13
11
/// <param name="length">The length of the virtual track.</param>
14
12
/// <returns>A new virtual track.</returns>
15
15
-
Track GetVirtual(double length = Double.PositiveInfinity);
13
13
+
Track GetVirtual(double length = double.PositiveInfinity);
16
14
}
17
15
}
+1
-2
osu.Framework/Input/States/ButtonStates.cs
···
1
1
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2
2
// See the LICENCE file in the repository root for full licence text.
3
3
4
4
-
using System;
5
4
using System.Collections;
6
5
using System.Collections.Generic;
7
6
using System.Linq;
···
67
66
pressedButtons.AddRange(other.pressedButtons);
68
67
}
69
68
70
70
-
public override string ToString() => $@"{GetType().ReadableName()}({String.Join(" ", pressedButtons)})";
69
69
+
public override string ToString() => $@"{GetType().ReadableName()}({string.Join(" ", pressedButtons)})";
71
70
72
71
public IEnumerator<TButton> GetEnumerator() => ((IEnumerable<TButton>)pressedButtons).GetEnumerator();
73
72
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();