rm KeyboardInput

GitOrigin-RevId: 1725d577c5be04488a6723b65c0c93fa25d12ab5
This commit is contained in:
Colin McMillen 2020-01-10 16:58:35 -05:00
parent 660d163119
commit 361a02c67f
3 changed files with 2 additions and 28 deletions

View File

@ -1,24 +0,0 @@
using Microsoft.Xna.Framework.Input;
using System.Collections.Generic;
namespace SemiColinGames {
public class KeyboardInput {
private KeyboardState oldState = Keyboard.GetState();
private List<Keys> newKeysDown = new List<Keys>();
public void Update() {
KeyboardState newState = Keyboard.GetState();
newKeysDown.Clear();
foreach (Keys k in newState.GetPressedKeys()) {
if (!oldState.IsKeyDown(k)) {
newKeysDown.Add(k);
}
}
oldState = newState;
}
public List<Keys> NewKeysDown() {
return newKeysDown;
}
}
}

View File

@ -14,9 +14,8 @@
<Compile Include="$(MSBuildThisFileDirectory)FpsCounter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)History.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IDisplay.cs" />
<Compile Include="$(MSBuildThisFileDirectory)KeyboardInput.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Player.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SneakGame.cs" />
<Compile Include="$(MSBuildThisFileDirectory)World.cs" />
</ItemGroup>
</Project>
</Project>

View File

@ -15,7 +15,6 @@
<Compile Include="History.cs" />
<Compile Include="IDisplay.cs" />
<Compile Include="SneakGame.cs" />
<Compile Include="KeyboardInput.cs" />
<Compile Include="Player.cs" />
<Compile Include="World.cs" />
</ItemGroup>
@ -24,4 +23,4 @@
</ItemGroup>
<Import Project="Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
</Project>