public override void OnRegister(CmdDispatcher <DMEnv> dispatcher) { dispatcher.Register("重复").Then( PresetNodes.Int <DMEnv>("次数").Then( PresetNodes.Cmd <DMEnv>("命令").Executes((env, args, dict) => Repeat(env, args.GetCmd("命令"), args.GetInt("次数"))) ) ); }
public override void OnRegister(CmdDispatcher <DMEnv> dispatcher) { dispatcher.RegisterCustom(Command_Roll.MainAction); dispatcher.RegisterCustom(Command_Check.MainAction); dispatcher.RegisterCustom( PresetNodes.String <DMEnv>("卡名") .Handles(Extensions.ExistInv) .Then( PresetNodes.Cmd <DMEnv>("行动") .Executes((env, args, dict) => Command_Control.ControlAndAct(env, args.GetInv("卡名"), args.GetCmd("行动"))) ) ); }
public override void OnRegister(CmdDispatcher <DMEnv> dispatcher) { dispatcher.Register("如果") .Then( PresetNodes.Cmd <DMEnv>("条件") .Then( PresetNodes.Cmd <DMEnv>("真值指令") .Executes((env, args, dict) => If(args.GetCmd("条件"), args.GetCmd("真值指令"), null)) .Then( PresetNodes.Cmd <DMEnv>("假值指令") .Executes((env, args, dict) => If(args.GetCmd("条件"), args.GetCmd("真值指令"), args.GetCmd("假值指令"))) ) ) ); dispatcher.SetAlias("若", "如果"); dispatcher.SetAlias("if", "如果"); }
public override void OnRegister(CmdDispatcher <DMEnv> dispatcher) { dispatcher.Register("控制") .Then( PresetNodes.Literal <DMEnv>("关联") .Executes((env, args, dict) => Relate(env)) ) .Then( PresetNodes.String <DMEnv>("卡名") .Handles(Extensions.ExistInv) .Executes((env, args, dict) => Control(env, env.SelfId, env.Sce, args.GetInv("卡名"))) .Then( PresetNodes.Cmd <DMEnv>("行动").Executes((env, args, dict) => ControlAndAct(env, args.GetInv("卡名"), args.GetCmd("行动"))) ) ); dispatcher.SetAlias("ct", "控制"); dispatcher.SetAlias("关联到此", "控制 关联"); }