GamePadButtonTrigger State Property Delta Engine Documentation

Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public State State { get; }

Property Value

Type: State
Remarks

Tests: DeltaEngine.Input.Tests.GamePadButtonTriggerTests
Examples

2 unit tests call DeltaEngine.Input.GamePadButtonTrigger.State
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new GamePadButtonTrigger(GamePadButton.Y, State.Pressed);
    Assert.AreEqual(GamePadButton.Y, trigger.Button);
    Assert.AreEqual(State.Pressed, trigger.State);
}
    [Test, CloseAfterFirstFrame]
    public void CreateFromAttributes()
    {
        var trigger = new GamePadButtonTrigger(new Dictionary<string, string>
            {
                { "Button", "Y" },
                { "State", " Pressed" }
            });
        Assert.AreEqual(GamePadButton.Y, trigger.Button);
        Assert.AreEqual(State.Pressed, trigger.State);
        Assert.Throws<GamePadButtonTrigger.CannotCreateGamePadTriggerWithoutKey>(
            () => new GamePadButtonTrigger(new Dictionary<string, string>()));
    }
}
See Also