MoveInput
namespace Griff.Modules.Fighting;
public struct MoveInputWhat a fighter presses for a move, in the numpad notation fighting games write moves in: the directions as the keys of a number pad, for a fighter facing right (6 forward, 4 back, 2 down, 8 up, 3 down-forward and so on, 5 none), then the button. 5P is a punch standing, 2K a kick crouching, 236P a quarter circle forward and punch, 623P a dragon punch (forward, down, down-forward), [4]6P back held a moment (a charge) then forward and punch, and j.K a kick in the air. Directions are read the way the fighter faces, so a motion works from either side.
Properties
Section titled “Properties”public bool Air { get; }True for a move done in the air (written with j. in front): it comes out only while jumping.
Button
Section titled “Button”public string Button { get; }The button pressed as the motion ends, e.g. “P”: one of the fighter’s Buttons.
Charge
Section titled “Charge”public int Charge { get; }The direction held a moment first for a charge move ([4]6P holds 4), or 0 for none.
Common
Section titled “Common”public static IReadOnlyList<ValueTuple<string, string>> Common { get; }The names of the motions fighting games share: “236” is a quarter circle forward.
IsSpecial
Section titled “IsSpecial”public bool IsSpecial { get; }True for a special move: a motion of more than one direction, or a charge. What a move’s “cancels special” can cancel into.
Motion
Section titled “Motion”public string Motion { get; }The directions pressed in turn, as numpad digits (“236”): one for a normal (“5”, “2”), none for any direction.
Methods
Section titled “Methods”public static char Arrow(int direction)The arrow for a numpad direction (6 is →), or “•” for 5.
Arrows
Section titled “Arrows”public string Arrows()Its directions as arrows for a fighter facing right, e.g. “↓↘→ P”, “[←]→ P” or “↓ K (in the air)”.
Describe
Section titled “Describe”public string Describe()What it’s called, e.g. “quarter circle forward + P”, “dragon punch + P”, “charge back, forward + P”, “down + K”, “P in the air”.
DirectionName
Section titled “DirectionName”public static string DirectionName(int direction)A numpad direction’s name for a fighter facing right: 6 is “forward”, 1 “down-back”, 5 “neutral”.
Equals
Section titled “Equals”public override bool Equals(object obj)Equals
Section titled “Equals”public bool Equals(MoveInput other)GetHashCode
Section titled “GetHashCode”public override int GetHashCode()MotionName
Section titled “MotionName”public static string? MotionName(string motion)The name of a common motion (“236” is “quarter circle forward”), or null.
public static MoveInput Parse(string text)Reads a move’s input, throwing for one that doesn’t make sense.
ToString
Section titled “ToString”public override string ToString()The input as it’s written, e.g. j.236K or [4]6P.
TryParse
Section titled “TryParse”public static bool TryParse(string? text, out MoveInput input, out string? problem)Reads a move’s input, e.g. 236P, [4]6K, j.2K or P, forgiving spaces and a + before the button (“236 + P”). False with why for one that doesn’t make sense.
Fields
Section titled “Fields”MaxSteps
Section titled “MaxSteps”public const int MaxStepsThe most directions a motion has.