Skip to content

Commit 98f9a6a

Browse files
committed
Tidying up
Referencing MG.Portable library
1 parent ee8c0ac commit 98f9a6a

File tree

10 files changed

+37
-82
lines changed

10 files changed

+37
-82
lines changed

InputStateManager/InputStateManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
// For more information, please refer to <http://unlicense.org>
2626
// ***************************************************************************
2727

28+
using Inputs.Inputs.GamePad;
29+
using Inputs.Inputs.Keyboard;
30+
using Inputs.Inputs.Mouse;
31+
using Inputs.Inputs.TouchPanel;
2832
using JetBrains.Annotations;
2933

3034
namespace Inputs

InputStateManager/Inputs.csproj

Lines changed: 8 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -37,76 +37,26 @@
3737
<HintPath>packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll</HintPath>
3838
<Private>True</Private>
3939
</Reference>
40-
<Reference Include="MonoGame.Framework, Version=3.6.0.1598, Culture=neutral, processorArchitecture=MSIL">
41-
<SpecificVersion>False</SpecificVersion>
42-
<HintPath>..\..\..\Program Files (x86)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll</HintPath>
40+
<Reference Include="MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, processorArchitecture=MSIL">
41+
<HintPath>packages\MonoGame.Framework.Portable.3.6.0.1625\lib\portable-net45+win8+wpa81\MonoGame.Framework.dll</HintPath>
42+
<Private>True</Private>
4343
</Reference>
4444
<Reference Include="System" />
4545
<Reference Include="Microsoft.CSharp" />
4646
<Reference Include="System.Xml" />
4747
</ItemGroup>
4848
<ItemGroup>
49-
<Compile Include="Pad.cs" />
50-
<Compile Include="Helpers\GamePadStates.cs" />
49+
<Compile Include="Inputs\GamePad\GamePadStates.cs" />
50+
<Compile Include="Inputs\GamePad\Pad.cs" />
5151
<Compile Include="InputStateManager.cs" />
52-
<Compile Include="Key.cs" />
53-
<Compile Include="Mouse.cs" />
52+
<Compile Include="Inputs\Keyboard\Key.cs" />
53+
<Compile Include="Inputs\Mouse\Mouse.cs" />
5454
<Compile Include="Properties\AssemblyInfo.cs" />
55-
<Compile Include="Touch.cs" />
55+
<Compile Include="Inputs\TouchPanel\Touch.cs" />
5656
</ItemGroup>
5757
<ItemGroup>
58-
<None Include="..\..\..\Program Files %28x86%29\MonoGame\v3.0\Assemblies\DesktopGL\libopenal.1.dylib">
59-
<Link>libopenal.1.dylib</Link>
60-
</None>
61-
<None Include="..\..\..\Program Files %28x86%29\MonoGame\v3.0\Assemblies\DesktopGL\libSDL2-2.0.0.dylib">
62-
<Link>libSDL2-2.0.0.dylib</Link>
63-
</None>
64-
<None Include="..\..\..\Program Files %28x86%29\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll.config">
65-
<Link>MonoGame.Framework.dll.config</Link>
66-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
67-
</None>
68-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x64\libopenal.so.1">
69-
<Link>x64\libopenal.so.1</Link>
70-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
71-
</None>
72-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x64\libSDL2-2.0.so.0">
73-
<Link>x64\libSDL2-2.0.so.0</Link>
74-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
75-
</None>
76-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x86\libopenal.so.1">
77-
<Link>x86\libopenal.so.1</Link>
78-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
79-
</None>
80-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x86\libSDL2-2.0.so.0">
81-
<Link>x86\libSDL2-2.0.so.0</Link>
82-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
83-
</None>
8458
<None Include="packages.config" />
8559
</ItemGroup>
86-
<ItemGroup>
87-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x64\SDL2.dll">
88-
<Link>x64\SDL2.dll</Link>
89-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
90-
</None>
91-
</ItemGroup>
92-
<ItemGroup>
93-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x64\soft_oal.dll">
94-
<Link>x64\soft_oal.dll</Link>
95-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
96-
</None>
97-
</ItemGroup>
98-
<ItemGroup>
99-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x86\SDL2.dll">
100-
<Link>x86\SDL2.dll</Link>
101-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
102-
</None>
103-
</ItemGroup>
104-
<ItemGroup>
105-
<None Include="..\..\..\program files %28x86%29\monogame\v3.0\assemblies\desktopgl\x86\soft_oal.dll">
106-
<Link>x86\soft_oal.dll</Link>
107-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
108-
</None>
109-
</ItemGroup>
11060
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
11161
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
11262
Other similar extension points exist, see Microsoft.Common.targets.

InputStateManager/Helpers/GamePadStates.cs renamed to InputStateManager/Inputs/GamePad/GamePadStates.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
using Microsoft.Xna.Framework;
3030
using Microsoft.Xna.Framework.Input;
3131

32-
namespace Inputs.Helpers
32+
namespace Inputs.Inputs.GamePad
3333
{
3434
[PublicAPI]
3535
class GamePadStates
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
// ***************************************************************************
2727

2828
using System;
29-
using Inputs.Helpers;
3029
using JetBrains.Annotations;
3130
using Microsoft.Xna.Framework;
3231
using Microsoft.Xna.Framework.Input;
3332

34-
namespace Inputs
33+
namespace Inputs.Inputs.GamePad
3534
{
3635
[PublicAPI]
3736
public class Pad
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
using JetBrains.Annotations;
3030
using Microsoft.Xna.Framework.Input;
3131

32-
namespace Inputs
32+
namespace Inputs.Inputs.Keyboard
3333
{
3434
[PublicAPI]
3535
public class Key
@@ -59,7 +59,7 @@ internal Key()
5959
internal void Update()
6060
{
6161
OldState = State;
62-
State = Keyboard.GetState();
62+
State = Microsoft.Xna.Framework.Input.Keyboard.GetState();
6363
}
6464

6565
[PublicAPI]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
using Microsoft.Xna.Framework;
3131
using Microsoft.Xna.Framework.Input;
3232

33-
namespace Inputs
33+
namespace Inputs.Inputs.Mouse
3434
{
3535
[PublicAPI]
3636
public class Mouse

InputStateManager/Touch.cs renamed to InputStateManager/Inputs/TouchPanel/Touch.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
using Microsoft.Xna.Framework;
3131
using Microsoft.Xna.Framework.Input.Touch;
3232

33-
namespace Inputs
33+
namespace Inputs.Inputs.TouchPanel
3434
{
3535
[PublicAPI]
3636
public class Touch
@@ -51,17 +51,17 @@ internal Touch()
5151
Was = new WasSub();
5252
}
5353

54-
public int DisplayHeight => TouchPanel.DisplayHeight;
55-
public int DisplayWidth => TouchPanel.DisplayWidth;
56-
public DisplayOrientation DisplayOrientation => TouchPanel.DisplayOrientation;
57-
public bool IsGestureAvailable => TouchPanel.IsGestureAvailable;
58-
public bool EnableMouseGestures => TouchPanel.EnableMouseGestures;
59-
public bool EnableMouseTouchPoint => TouchPanel.EnableMouseTouchPoint;
60-
public GestureType EnabledGestures => TouchPanel.EnabledGestures;
61-
public IntPtr WindowHandle => TouchPanel.WindowHandle;
62-
public TouchPanelCapabilities GetCapabilities => TouchPanel.GetCapabilities();
54+
public int DisplayHeight => Microsoft.Xna.Framework.Input.Touch.TouchPanel.DisplayHeight;
55+
public int DisplayWidth => Microsoft.Xna.Framework.Input.Touch.TouchPanel.DisplayWidth;
56+
public DisplayOrientation DisplayOrientation => Microsoft.Xna.Framework.Input.Touch.TouchPanel.DisplayOrientation;
57+
public bool IsGestureAvailable => Microsoft.Xna.Framework.Input.Touch.TouchPanel.IsGestureAvailable;
58+
public bool EnableMouseGestures => Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnableMouseGestures;
59+
public bool EnableMouseTouchPoint => Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnableMouseTouchPoint;
60+
public GestureType EnabledGestures => Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnabledGestures;
61+
public IntPtr WindowHandle => Microsoft.Xna.Framework.Input.Touch.TouchPanel.WindowHandle;
62+
public TouchPanelCapabilities GetCapabilities => Microsoft.Xna.Framework.Input.Touch.TouchPanel.GetCapabilities();
6363

64-
public GestureSample ReadGesture() => TouchPanel.ReadGesture();
64+
public GestureSample ReadGesture() => Microsoft.Xna.Framework.Input.Touch.TouchPanel.ReadGesture();
6565

6666
private bool emulateWithMouse;
6767

@@ -72,11 +72,11 @@ public bool EmulateWithMouse
7272
{
7373
if (!emulateWithMouse)
7474
{
75-
TouchPanel.EnabledGestures = GestureType.Hold | GestureType.Tap | GestureType.DoubleTap |
75+
Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnabledGestures = GestureType.Hold | GestureType.Tap | GestureType.DoubleTap |
7676
GestureType.DragComplete | GestureType.Flick | GestureType.FreeDrag |
7777
GestureType.HorizontalDrag | GestureType.VerticalDrag;
78-
TouchPanel.EnableMouseGestures = true;
79-
TouchPanel.EnableMouseTouchPoint = true;
78+
Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnableMouseGestures = true;
79+
Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnableMouseTouchPoint = true;
8080
}
8181
emulateWithMouse = value;
8282
}
@@ -85,7 +85,7 @@ public bool EmulateWithMouse
8585
internal void Update()
8686
{
8787
Was.Collection = Is.Collection;
88-
Is.Collection = TouchPanel.GetState();
88+
Is.Collection = Microsoft.Xna.Framework.Input.Touch.TouchPanel.GetState();
8989
}
9090

9191
[PublicAPI]

InputStateManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.3")]
36-
[assembly: AssemblyFileVersion("1.0.0.3")]
35+
[assembly: AssemblyVersion("1.0.0.4")]
36+
[assembly: AssemblyFileVersion("1.0.0.4")]

InputStateManager/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
4+
<package id="MonoGame.Framework.Portable" version="3.6.0.1625" targetFramework="net461" />
45
</packages>

Test/Game1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828
using System.Text;
2929
using Inputs;
30+
using Inputs.Inputs.GamePad;
3031
using Microsoft.Xna.Framework;
3132
using Microsoft.Xna.Framework.Graphics;
3233
using Microsoft.Xna.Framework.Input;
33-
using Mouse = Inputs.Mouse;
34+
using Mouse = Inputs.Inputs.Mouse.Mouse;
3435

3536
namespace Test
3637
{

0 commit comments

Comments
 (0)