Exemple #1
0
 // hand an answered input request
 public Delta[] FinishInputRequest(Player player, InputRequest req)
 {
     if (!req.Made) // deal with unfinished req; this honestly should probably just error
     {
         return(new Delta[] {});
     }
     Delta[] deltas = req.GetDeltas();
     player.FinishInputRequest(req);
     return(deltas);
 }
        public static InputRequest FromXml(XmlElement e)
        {
            // find in there is already an Input Request with the same ID
            string       id       = e.Attributes["id"].Value;
            InputRequest sharedId = idIssuer.GetByID(id);

            // ...if there is, just migrate data to that one
            if (sharedId != null && sharedId.MakeChoiceFrom(e))
            {
                return(sharedId);
            }
            // if that rought failed to return...
            object[] args = new object[] { e };
            return(SendableFactory <InputRequest> .FromXml(e, args));
        }