/// <summary> /// Creates a new InputState whose ButtonMaps are a copy of this instance's. /// </summary> /// <returns>A copy of this instance.</returns> public InputState Clone() { InputState state = new InputState(); state.Set(this); return state; }
/// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="subsystems">The collection of subsystems.</param> public InputSystem(SubSystems subsystems) : base(subsystems) { m_keymap = new Dictionary<Keys, ButtonWrapper>(); m_previousstate = new KeyboardState(); m_inputstatestack = new Stack<InputState>(); m_currentinput = new InputState(); m_callbackcache = new List<Action<Boolean>>(); }
/// <summary> /// Copies the input callbacks of the given InputState. /// </summary> /// <param name="state">The InputState to copy.</param> public void Set(InputState state) { if (state == null) throw new ArgumentNullException("state"); for (Int32 i = 0; i != m_buttonmaps.Count; ++i) { this[i].Set(state[i]); } }