namespace Otter {
///
/// Class that is used for debug input. Wraps the Input class but only works when debug input
/// is enabled.
///
public class DebugInput {
#region Static Fields
///
/// The active instance of DebugInput.
///
public static DebugInput Instance;
#endregion
#region Public Fields
///
/// Determines if debug input will be used. If false all checks will return false.
///
public bool Enabled;
///
/// The parent Game.
///
public Game Game;
#endregion
#region Public Methods
///
/// Check if a key was pressed.
///
/// The key to check.
/// True if that key was pressed.
public bool KeyPressed(Key k) {
if (!Enabled) return false;
return Game.Input.KeyPressed(k);
}
///
/// Check if a key was released.
///
/// The key to check.
/// True if that key was released.
public bool KeyReleased(Key k) {
if (!Enabled) return false;
return Game.Input.KeyReleased(k);
}
///
/// Check if a key is down.
///
/// The key to check.
/// True if that key is down.
public bool KeyDown(Key k) {
if (!Enabled) return false;
return Game.Input.KeyDown(k);
}
///
/// Check if a key is up.
///
/// The key to check.
/// True if that key is up.
public bool KeyUp(Key k) {
if (!Enabled) return false;
return Game.Input.KeyUp(k);
}
#endregion
#region Internal
internal DebugInput(Game game) {
Game = game;
Instance = this;
#if DEBUG
Enabled = true;
#endif
}
#endregion
}
}