AxiosEngine-old 

AxiosEngine-old Commit Details


Date:2012-06-03 15:42:00 (12 years 6 months ago)
Author:Natalie Adams
Branch:default
Commit:c4ca3b5877b0
Parents: 9e5a38542239
Message:Adding inputstate extension

Changes:
Aaxios/Engine/Extensions/InputState.cs (full)

File differences

axios/Engine/Extensions/InputState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameStateManagement;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace Axios.Engine.Extensions
{
public static class AxiosExtensions_InputState
{
// I got tired of always specifying Player one
//-- Nathan Adams [adamsna@datanethost.net] - 6/3/2012
/// <summary>
/// This checks if the key is pressed by player one
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyPressed(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsKeyPressed(key, PlayerIndex.One, out p);
}
public static bool IsButtonPressed(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsButtonPressed(button, PlayerIndex.One, out p);
}
public static bool IsNewKeyPress(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsNewKeyPress(key, PlayerIndex.One, out p);
}
public static bool IsNewButtonPress(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsNewButtonPress(button, PlayerIndex.One, out p);
}
public static bool IsNewButtonRelease(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsNewButtonRelease(button, PlayerIndex.One, out p);
}
public bool IsNewKeyRelease(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsNewKeyRelease(key, PlayerIndex.One, out p);
}
}
}

Archive Download the corresponding diff file

Page rendered in 0.42519s using 14 queries.