Esempio n. 1
0
 public override void TriggerBehaviour(MessageBase message)
 {
     if (BehaviourEvent != null)
     {
         BehaviourEvent(message);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 想起东西
 /// </summary>
 public override List<MessageBase> Get(MessageBase message)
 {
     return memoryBlock.FindAll(o =>
     {
         return o.ToString().Contains(message.Message);
     });
 }
Esempio n. 3
0
 /// <summary>
 /// 添加记忆
 /// </summary>
 public void Add(MessageBase message)
 {
     List<MessageBase> list = sensoryMenoryInstance.Get(message);
     if (list.Count != 0)
     {
         list[0].Priority += 1;
     }
     else
     {
         sensoryMenoryInstance.Set(message);
     }
 }
Esempio n. 4
0
 public abstract void TriggerBehaviour(MessageBase message);
Esempio n. 5
0
 /// <summary>
 /// 查询记忆
 /// </summary>
 public List<MessageBase> Query(MessageBase message)
 {
     return sensoryMenoryInstance.Get(message);
 }
Esempio n. 6
0
 /// <summary>
 /// 记忆东西
 /// </summary>
 public override void Set(MessageBase message)
 {
     memoryBlock.Add(message);
 }
Esempio n. 7
0
 /// <summary>
 /// 记忆东西
 /// </summary>
 public abstract void Set(MessageBase message);
Esempio n. 8
0
 /// <summary>
 /// 想起东西
 /// </summary>
 public abstract List<MessageBase> Get(MessageBase message);
Esempio n. 9
0
 /// <summary>
 /// 存储信息
 /// </summary>
 private void Store(MessageBase message)
 {
     //简单的存储--感觉记忆
     memorySystem.Add(message);
 }
Esempio n. 10
0
 void rest_BehaviourEvent(MessageBase message)
 {
     TriggerOutPutLogsEvent("我睡觉了,不要打扰我!");
 }
Esempio n. 11
0
        void imitate_BehaviourEvent(MessageBase message)
        {
            TriggerOutPutLogsEvent("我模仿了信息:"+message.Message);

            //模仿
            TriggerOutPutEvent(message.Message);
        }
Esempio n. 12
0
        /// <summary>
        /// 分析传输进来的数据
        /// </summary>
        /// <param name="message"></param>
        private void DealWidthMessage(MessageBase message)
        {
            List<MessageBase> oldMemoryList = memorySystem.Query(message);

            if (oldMemoryList.Count > 0)
            {

                MessageBase oldMemory = oldMemoryList[0];

                //大于10次触发 本能行为---模仿
                if (oldMemory.Priority >= 10)
                {
                    imitate.TriggerBehaviour(message);

                }

                TriggerOutPutLogsEvent("你的话让我想起了[" + oldMemory.Message + "]记忆次数:" + oldMemory.Priority.ToString());
            }
            else
            {
                TriggerOutPutLogsEvent("我什么也没想起来!");

                //没有听说过 触发好奇行为
                curious.TriggerBehaviour(message);
            }

            //存储接收的数据
            TriggerOutPutLogsEvent("我暂时记住了:" + message.Message);
            this.Store(message);
        }
Esempio n. 13
0
        void curious_BehaviourEvent(MessageBase message)
        {
            TriggerOutPutLogsEvent(message.Message+",引起了我的好奇");

            //模仿
            TriggerOutPutEvent("我很好奇,能解释一下什么意思吗?");
        }