FieldCommandIcons.cs

The FieldCommandIcons class is a static utility class that returns file paths for various UI icons used for field commands and orders. It implements logic to map different action types, such as movement, attacks, or specific command types, to corresponding icon filenames.

using Socer;

// One authored vector set for command feedback, active orders and the wheel.
public static class FieldCommandIcons
{
    static string Asset(string name)=>"/ui-icons/field-command-"+name+".svg";
    public static string For(FieldPingKind kind)=>Asset(kind switch
    {
        FieldPingKind.Move=>"move",FieldPingKind.Run=>"run",FieldPingKind.Zone=>"zone",
        FieldPingKind.Press=>"press",FieldPingKind.Mark=>"mark",FieldPingKind.Attack=>"attack",
        FieldPingKind.Pass=>"pass",FieldPingKind.Clear=>"clear",_=>"select"
    });
    public static string For(FieldCommand kind)=>Asset(kind switch
    {
        FieldCommand.Move=>"move",FieldCommand.Run=>"run",FieldCommand.Zone=>"zone",
        FieldCommand.Press=>"press",FieldCommand.Mark=>"mark",FieldCommand.Attack=>"attack",
        FieldCommand.Shoot=>"shoot",FieldCommand.Pass=>"pass",FieldCommand.Clear=>"clear",_=>"select"
    });
    public static string ForOrder(DirectOrderKind kind,bool passing=false)=>passing?Asset("pass"):Asset(kind switch
    {
        DirectOrderKind.AttackRun=>"run",DirectOrderKind.GuardZone=>"zone",
        DirectOrderKind.PressPlayer=>"press",DirectOrderKind.MarkPlayer=>"mark",_=>"select"
    });
    public static string Dismiss=>Asset("dismiss");
}