Exemplo n.º 1
0
        public IActionResult Action([FromBody] UserActionDto userAction)
        {
            var game   = Game.Instance;
            var person = game.People.Find(p => p.Id == userAction.PersonClicked);

            person.GoHome();
            return(NoContent());
        }
Exemplo n.º 2
0
        public bool EditUserAction(Guid flowId, UserActionDto actionDto)
        {
            var flow  = Flows[flowId];
            var index = flow.UserActionList.FindIndex(x => x.ActionNumber == actionDto.ActionNumber);

            var action = new UserAction()
            {
                ActionNumber            = actionDto.ActionNumber,
                MilisecondsToNextAction = actionDto.MilisecondsToNextAction,
                Position     = actionDto.Position,
                DragPosition = actionDto.DragPosition,
                DoubleClick  = actionDto.DoubleClick,
                ControlName  = actionDto.ControlName,
                ControlType  = actionDto.ControlType
            };

            flow.UserActionList[index] = action;
            Flows[flow.Id]             = flow;

            _logger.LogInformation($"Action {action.ActionNumber} from flow {flowId} has been updated");
            return(true);
        }