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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 5
0
 private void SendAnswer(ClientAction action, ActionAnswer answer)
 {
     Send(new ClientAnswer(action, answer));
 }
Exemplo n.º 6
0
 public ClientAnswer(ClientAction action, ActionAnswer answer)
 {
     Id           = action.Id;
     IsSuccessful = answer.IsSuccessful;
     Data         = answer.Data;
 }