예제 #1
0
 public MessageAlarm(IntentEnum intent, double confidence, DateTime time, double timeConfidence, int days, string message) : this(intent, confidence)
 {
     Time           = time;
     TimeConfidence = timeConfidence;
     DaysEnabled    = days;
     Note           = message;
 }
예제 #2
0
 public MessageWeather(IntentEnum intent, double confidence, string location, double locationConfidence, DateTime when, double whenConfidence) : this(intent, confidence)
 {
     Location           = location;
     LocationConfidence = locationConfidence;
     When           = when;
     WhenConfidence = whenConfidence;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IntentAction"/> class
 /// </summary>
 /// <param name="intent">Target intent</param>
 /// <param name="issingPlayerId">The player who issued this intent</param>
 /// <param name="card">the card involved, null if creature combat</param>
 /// <param name="sourceId">the attacking creature, if applicable</param>
 /// <param name="targetId">the receiver, either creature Id or player Id if applicable</param>
 public IntentAction(IntentEnum intent, int issingPlayerId, Card card, int sourceId, int targetId)
 {
     this.Intent          = intent;
     this.IssuingPlayerId = issingPlayerId;
     this.Card            = card;
     this.SourceId        = sourceId;
     this.TargetId        = targetId;
 }
예제 #4
0
 public Message(IntentEnum intent, double confidence)
 {
     MessageIntent = intent;
     Confidence    = confidence;
     Created       = DateTime.Now;
     RawMessage    = "";
     Note          = "";
 }
예제 #5
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public virtual void Parse(JObject jo)
        {
            intent = (IntentEnum)Enum.Parse(typeof(IntentEnum), (string)jo["intent"]);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            action = joDetails.TryGetValue("action", out jt) ? (string)jt : null;
            answer = joDetails.TryGetValue("answer", out jt) ? (string)jt : null;
            dialog = joDetails.TryGetValue("dialog", out jt) ? (string)jt : null;
        }
예제 #6
0
        /// <summary>
        /// Adds a new intent
        /// </summary>
        /// <param name="intent">Target intent</param>
        /// <param name="issuingPlayerId">The player who issued this intent</param>
        /// <param name="card">the card involved, null if creature combat</param>
        /// <param name="sourceId">the attacking creature, if applicable</param>
        /// <param name="targetId">the receiver, either creature Id or player Id if applicable</param>
        public void AddIntent(IntentEnum intent, int issuingPlayerId, Card card, int sourceId, int targetId)
        {
            // If current intent is pass, check last action to see if it was also pass. If so, resolve
            if (intent == IntentEnum.PassTurn && this.ActionStack.Count > 0 && this.ActionStack.Peek().Intent == IntentEnum.PassTurn)
            {
                this.ResolvePendingActions();
            }
            else
            {
                var newIntent = new IntentAction(intent, issuingPlayerId, card, sourceId, targetId);
                this.ActionStack.Push(newIntent);
            }

            // Renders all components
            TurnManager.CurrentInstance.Render();
            this.LastPlayedIntentCardComponent.Render();
            this.Render();
        }
 public void MoveObject()
 {
     intent = IntentEnum.Move;
     Debug.Log($"Set intent to {intent}");
     SpeechManager.Instance.Speech($"Set intent to {intent}");
 }
 public void ChangeColor()
 {
     intent = IntentEnum.ChangeColor;
     Debug.Log($"Set intent to {intent}");
     SpeechManager.Instance.Speech($"Set intent to {intent}");
 }
예제 #9
0
 /// <summary>
 /// Commits a normal card use on a creature or health card
 /// </summary>
 /// <param name="intent">Target intent</param>
 /// <param name="issuingPlayerId">The player who issued this intent</param>
 /// <param name="card">the card involved, null if creature combat</param>
 /// <param name="sourceId">the attacking creature, if applicable</param>
 /// <param name="targetId">the receiver, either creature Id or player Id if applicable</param>
 public void CommitCardUse(IntentEnum intent, int issuingPlayerId, Card card, int sourceId, int targetId)
 {
     IntentManager.CurrentInstance.AddIntent(intent, issuingPlayerId, card, sourceId, targetId);
     TurnManager.CurrentInstance.Render();
 }
예제 #10
0
 public void RpcCommitCardUse(IntentEnum intent, int issuingPlayerId, Card card, int sourceId, int targetId)
 {
     this.CommitCardUse(intent, issuingPlayerId, card, sourceId, targetId);
 }
예제 #11
0
 public static PdfName Name(
     this IntentEnum intent
     )
 {
     return(codes[intent]);
 }
예제 #12
0
 public MessageNote(IntentEnum intent, double confidence) : base(intent, confidence)
 {
 }
예제 #13
0
 public MessageAlarm(IntentEnum intent, double confidence, DateTime time, double timeConfidence) : this(intent, confidence)
 {
     Time           = time;
     TimeConfidence = timeConfidence;
 }
예제 #14
0
 public MessageWeather(IntentEnum intent, double confidence) : base(intent, confidence)
 {
 }
예제 #15
0
 public MessageTranslate(IntentEnum intent, double confidence, string translate) : base(intent, confidence)
 {
     this.RawMessage = translate;
 }