public ActionResult <GalaxyPadProcessApiModel> Post([FromRoute] string pid, [FromBody] string memory) { var process = processService.FindProcess(pid); if (process == null) { return(NotFound(pid)); } Data?data = memory.ParseDataPrettyFormattedString(); APad apad = ProcessAPad(() => process.ChangeMemory(data)); var nextPid = processService.Save(apad); return(new GalaxyPadProcessApiModel(nextPid, apad.LastCommand, apad.Screens, apad.Memory.PrettyFormat(), (int)apad.TimeTaken.TotalMilliseconds)); }
public ActionResult <GalaxyPadProcessApiModel> Post([FromRoute] string pid, [FromBody] int[] xy) { var process = processService.FindProcess(pid); if (process == null) { return(NotFound(pid)); } var x = xy[0]; var y = xy[1]; APad apad = ProcessAPad(() => process.ProcessClick(x, y)); var nextPid = processService.Save(apad !); return(new GalaxyPadProcessApiModel(nextPid, apad.LastCommand, apad.Screens, apad.Memory.PrettyFormat(), (int)apad.TimeTaken.TotalMilliseconds)); }