A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using System;
5using JetBrains.Annotations;
6using osu.Framework.Input.States;
7
8namespace osu.Framework.Input.StateChanges.Events
9{
10 /// <summary>
11 /// An event which represents a change of an <see cref="InputState"/>.
12 /// An <see cref="IInput"/> produces this type of event after it changes <see cref="State"/>.
13 /// </summary>
14 public abstract class InputStateChangeEvent
15 {
16 /// <summary>
17 /// The <see cref="InputState"/> changed by this event.
18 /// </summary>
19 [NotNull]
20 public readonly InputState State;
21
22 /// <summary>
23 /// The <see cref="IInput"/> that caused this input state change.
24 /// </summary>
25 [CanBeNull]
26 public readonly IInput Input;
27
28 protected InputStateChangeEvent(InputState state, IInput input)
29 {
30 State = state ?? throw new ArgumentNullException(nameof(state));
31 Input = input;
32 }
33 }
34}