/// <summary> /// Constructs movement data. /// </summary> /// <param name="walk">Must be a valid movement. CANNOT be a noop.</param> /// <param name="run">Optional, if set, movement is will be interpreted as running.</param> public MoveMessage(DirectionDelta walk, DirectionDelta run) { Debug.Assert(!walk.IsNoop()); Dir1 = walk; Dir2 = run; IsWalking = Dir2.IsNoop(); }
public GeneratedDirections(DirectionDelta walk, DirectionDelta run) { // if walk is noop but run isin't, swap places if (walk.IsNoop() && !run.IsNoop()) { Walk = run; Run = walk; } else { Walk = walk; Run = run; } }