public void AddActionToHandleListener(DynamicActionEvent dynamicActionEvent) { //TODO add more complex way to take actions ActionAnswer actionAnswer = dynamicActionEvent.ActionAnswers[0]; ActionResponseEvent actionResponseEvent = new ActionResponseEvent(dynamicActionEvent, actionAnswer); _eventBus.Post(actionResponseEvent); }
/// <summary> /// Colects all answers and returns the answer with the highest priority. /// </summary> /// <param name="point">The position of mouse when was clicked.</param> /// <param name="hitObject">The result of a HitTest.</param> /// <param name="isFriendly">The information if the hitted object is friendly.</param> /// <param name="isMovableGameObject">The information if the hitted object is movable.</param> /// <returns></returns> public ActionAnswer OnMouseAction(Vector3 point, MovableObject hitObject, bool isFriendly, bool isMovableGameObject) { ActionAnswer groupAnswer = ActionAnswer.None; foreach (IMovableGameObject imgo in groupMembers) { ActionAnswer answer = imgo.OnMouseAction(point, hitObject, isFriendly, isMovableGameObject); if (answer > groupAnswer) { groupAnswer = answer; } } return(groupAnswer); }
public ClientAnswer(ClientAction action, ActionAnswer answer) { Id = action.Id; IsSuccessful = answer.IsSuccessful; Message = answer.Message; }
public ActionResponseEvent(DynamicActionEvent actionEvent, ActionAnswer selectedAnswer) { ActionEvent = actionEvent; SelectedAnswer = selectedAnswer; }
private void SendAnswer(ClientAction action, ActionAnswer answer) { Send(new ClientAnswer(action, answer)); }
public ClientAnswer(ClientAction action, ActionAnswer answer) { Id = action.Id; IsSuccessful = answer.IsSuccessful; Data = answer.Data; }