コード例 #1
0
ファイル: GameControlKeys.cs プロジェクト: wtfcolt/game
 /// <summary>
 /// Initializes a new instance of the <see cref="GameControlKeys"/> class.
 /// </summary>
 /// <param name="name">The name of the <see cref="GameControlKeys"/>. Cannot be null.</param>
 /// <param name="keyDown">The key required to be down.</param>
 /// <param name="keyUp">The key required to be up.</param>
 /// <param name="newKeyDown">The key required to be down this frame, and up last frame.</param>
 public GameControlKeys(string name, IKeyCodeReference keyDown, IKeyCodeReference keyUp = null,
                        IKeyCodeReference newKeyDown = null)
 {
     Name = name;
     KeysDown = keyDown != null ? new IKeyCodeReference[] { keyDown } : _emptyKeys;
     KeysUp = keyUp != null ? new IKeyCodeReference[] { keyUp } : _emptyKeys;
     NewKeysDown = newKeyDown != null ? new IKeyCodeReference[] { newKeyDown } : _emptyKeys;
 }
コード例 #2
0
ファイル: GameControlKeys.cs プロジェクト: wtfcolt/game
 /// <summary>
 /// Initializes a new instance of the <see cref="GameControlKeys"/> class.
 /// </summary>
 /// <param name="name">The name of the <see cref="GameControlKeys"/>. Cannot be null.</param>
 /// <param name="keyDown">The key required to be down.</param>
 /// <param name="keyUp">The key required to be up.</param>
 /// <param name="newKeyDown">The key required to be down this frame, and up last frame.</param>
 public GameControlKeys(string name, IKeyCodeReference keyDown, IKeyCodeReference keyUp = null,
                        IKeyCodeReference newKeyDown = null)
 {
     Name        = name;
     KeysDown    = keyDown != null ? new IKeyCodeReference[] { keyDown } : _emptyKeys;
     KeysUp      = keyUp != null ? new IKeyCodeReference[] { keyUp } : _emptyKeys;
     NewKeysDown = newKeyDown != null ? new IKeyCodeReference[] { newKeyDown } : _emptyKeys;
 }