/// <summary>
 /// 指定の文字列をメッセージ表示キューに登録します。
 /// </summary>
 /// <param name="mes"></param>
 public void SetMessage(Messages.MessageType mes)
 {
     if (mes != Messages.MessageType.None)
     {
         messageList.Add(mes);
     }
 }
 public Telegram(double time, int sender, int receiver, Messages.MessageType msgType, dynamic info = null) : this()
 {
     dispatchTime   = time;
     this.sender    = sender;
     this.receiver  = receiver;
     msg            = msgType;
     this.extraInfo = info;
 }
Exemple #3
0
 public static void ProcessMessage(Messages.PluginMessage msg)
 {
     Messages.MessageType type = msg.type;
     if (type == Messages.MessageType.kDialog_GotIMEDialogResult && Ime.OnGotIMEDialogResult != null)
     {
         Ime.OnGotIMEDialogResult(msg);
     }
 }
        //send a message to another agent. Receiving agent is referenced by ID.
        public void DispatchMsg(double delay, int sender, int receiver, Messages.MessageType msg, dynamic extraInfo)
        {
            //get a pointer to the receiver
            BaseGameEntity receiverRef = EntityManager.instance.GetEntityFromID(receiver);

            //make sure the receiver is valid
            if (receiverRef == null)
            {
                Logger.log("\nWarning! No Receiver with ID of " + receiver + " found", Logger.LogLevel.WARNING);
                return;
            }

            //create the telegram
            Telegram telegram = new Telegram(0, sender, receiver, msg, extraInfo);

            //if there is no delay, route telegram immediately
            if (delay <= 0.0)
            {
                Logger.log("Telegram dispatched by " + sender +
                           " for " + receiver + ". Msg is " + msg + "", Logger.LogLevel.INFO);

                //send the telegram to the recipient
                Discharge(receiverRef, ref telegram);
            }

            //else calculate the time when the telegram should be dispatched
            //else
            //{
            //  double CurrentTime = TickCounter->GetCurrentFrame();

            //  telegram.DispatchTime = CurrentTime + delay;

            //  //and put it in the queue
            //  PriorityQ.insert(telegram);

            //  #ifdef SHOW_MESSAGING_INFO
            //  debug_con << "\nDelayed telegram from " << sender << " recorded at time "
            //          << TickCounter->GetCurrentFrame() << " for " << receiver
            //          << ". Msg is " << msg << "";
            //  #endif
            //}
        }