Example #1
0
 public virtual void PlayerInput(ActionRequest response)
 {
     if (OutstandingActionRequests.ContainsKey(response.GetHashCode()))
     {
         OutstandingActionRequests.Remove(response.GetHashCode());
     }
     response.PerformResponse();
 }
Example #2
0
 /// <summary>
 /// Returns false the message can't be queued.
 /// </summary>
 /// <param name="actionRequest"></param>
 /// <returns></returns>
 protected bool SendRequest(ActionRequest actionRequest)
 {
     if (null == actionRequest)
     {
         return(true);
     }
     if (actionRequest.HasOptions)
     {
         if (OutstandingActionRequests.ContainsKey(actionRequest.GetHashCode()))
         {
             return(false);
         }
         OutstandingActionRequests.Add(actionRequest.GetHashCode(), actionRequest);
         GetPlayerInput(actionRequest);
     }
     else if (null != PlayerInputRequired)
     {
         PlayerInputRequired(this, actionRequest);
     }
     return(true);
 }