예제 #1
0
 public void broadCastMessage(AASMAMessage msg)
 {
     _broadCastPool.Add(msg);
 }
예제 #2
0
 public void sendMessage(AASMAMessage msg, String receiver)
 {
     msg.Receiver = receiver;
     _msgPool.Add(msg);
 }
예제 #3
0
 public override void receiveMessage(AASMAMessage msg)
 {
 }
예제 #4
0
 public abstract void receiveMessage(AASMAMessage msg);
예제 #5
0
        public override void receiveMessage(AASMAMessage msg)
        {
            // MESSAGES ARE TREATED AS BELIEFS UPDATES
            // message about hoshimi found
            if (msg.Content.Contains("hoshimi"))
            {
                bool empty = true;
                Point location = (Point)msg.Tag;
                foreach (NanoBot bot in getAASMAFramework().NanoBots)
                {
                    if(bot.GetType().Equals(typeof(NanoNeedle)) && bot.Location.Equals(location))
                    {
                        empty = false;
                    }
                }
                if(empty && !HoshimisAvailable.Contains(location)){
                    this.HoshimisAvailable.Add((Point)msg.Tag);
                    getAASMAFramework().logData(this._nanoAI, "New hoshimi point at: " + location.X + "," + location.Y);
                }
            }

            //message about hoshimi unavailable = remove hoshimi
        }