Exemple #1
0
 /// <summary>
 ///     Creates an instance of <see cref="FullInputCmdMessage"/> with an optional Entity reference.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="state">New state of the Input Function.</param>
 /// <param name="coordinates">Local Coordinates of the pointer when the command was created.</param>
 /// <param name="screenCoordinates"></param>
 /// <param name="uid">Entity that was under the pointer when the command was created.</param>
 public FullInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId, BoundKeyState state, GridCoordinates coordinates, ScreenCoordinates screenCoordinates, EntityUid uid)
     : base(tick, inputFunctionId)
 {
     State             = state;
     Coordinates       = coordinates;
     ScreenCoordinates = screenCoordinates;
     Uid = uid;
 }
        public bool TryGetKeyFunction(KeyFunctionId funcId, out BoundKeyFunction func)
        {
            var list  = KeyFunctionsList;
            var index = (int)funcId;

            if (0 > index || index >= list.Count)
            {
                func = default;
                return(false);
            }

            func = list[index];
            return(true);
        }
Exemple #3
0
 /// <summary>
 ///     Creates an instance of <see cref="EventInputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 public EventInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId)
     : base(tick, inputFunctionId)
 {
 }
Exemple #4
0
 /// <summary>
 ///     Creates an instance of <see cref="StateInputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="state">New state of the Input Function.</param>
 public StateInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId, BoundKeyState state)
     : base(tick, inputFunctionId)
 {
     State = state;
 }
Exemple #5
0
 /// <summary>
 ///     Creates an instance of <see cref="InputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 public InputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId)
 {
     Tick            = tick;
     InputFunctionId = inputFunctionId;
 }
Exemple #6
0
 /// <summary>
 ///     Creates an instance of <see cref="FullInputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="state">New state of the Input Function.</param>
 /// <param name="coordinates">Local Coordinates of the pointer when the command was created.</param>
 /// <param name="screenCoordinates"></param>
 public FullInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId, BoundKeyState state, GridCoordinates coordinates, ScreenCoordinates screenCoordinates)
     : this(tick, inputFunctionId, state, coordinates, screenCoordinates, EntityUid.Invalid)
 {
 }
Exemple #7
0
 /// <summary>
 ///     Creates an instance of <see cref="PointerInputCmdMessage"/> with an optional Entity reference.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="coordinates">Local Coordinates of the pointer when the command was created.</param>
 /// <param name="uid">Entity that was under the pointer when the command was created.</param>
 public PointerInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId, GridCoordinates coordinates, EntityUid uid)
     : base(tick, inputFunctionId)
 {
     Coordinates = coordinates;
     Uid         = uid;
 }
Exemple #8
0
 /// <summary>
 ///     Creates an instance of <see cref="PointerInputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="coordinates">Local Coordinates of the pointer when the command was created.</param>
 public PointerInputCmdMessage(GameTick tick, KeyFunctionId inputFunctionId, GridCoordinates coordinates)
     : this(tick, inputFunctionId, coordinates, EntityUid.Invalid)
 {
 }
 /// <summary>
 ///     Creates an instance of <see cref="FullInputCmdMessage"/>.
 /// </summary>
 /// <param name="tick">Client tick this was created.</param>
 /// <param name="inputSequence"></param>
 /// <param name="inputFunctionId">Function this command is changing.</param>
 /// <param name="state">New state of the Input Function.</param>
 /// <param name="coordinates">Local Coordinates of the pointer when the command was created.</param>
 /// <param name="screenCoordinates"></param>
 public FullInputCmdMessage(GameTick tick, ushort subTick, int inputSequence, KeyFunctionId inputFunctionId, BoundKeyState state, EntityCoordinates coordinates, ScreenCoordinates screenCoordinates)
     : this(tick, subTick, inputFunctionId, state, coordinates, screenCoordinates, EntityUid.Invalid)
 {
 }
 public BoundKeyFunction KeyFunctionName(KeyFunctionId function)
 {
     return(KeyFunctionsList[(int)function]);
 }