protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            EventHandler <OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #2
0
        protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.
            EventHandler <OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        //現在の考えが意見を形成したら。
        private void CurrentThought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            if (thoughts.Count < 2 || (thoughts.Count >= 2 && Opinion.Value != e.Opinion))
            {
                //自らのイベントを発火
                OnOpinionChanged(e);
            }


            //順番大切!
            AddThought();
        }
Exemple #4
0
        void thought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            //この段階では、前の段階のOpinionがある
            //thoughtStack.CurrentThought.Opinion

            NotifyOthers(e.Opinion);

            //自信のイベントも連鎖して発火
            OnOpinionChanged(e);


            //コノ後、新しい意見が積み重なってしまうので注意。
            //気を配らなきゃいけないのめんどくさいので設計ヨクない
        }
Exemple #5
0
 public void thought_OpinionChanged(object sender, OpinionEventArgs e)
 {
     NotifyOthers(e.Opinion);
     OnOpinionChanged(e);
 }
 void AgentOpinionChanged(object sender, OpinionEventArgs e)
 {
     //Console.WriteLine("opinion " + e.Opinion);
 }
Exemple #7
0
 void algorithm_OpinionChanged(object sender, OpinionEventArgs e)
 {
     OnOpinionChanged(e);
 }
        //現在の考えが意見を形成したら。
        private void CurrentThought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            if (thoughts.Count < 2 || ( thoughts.Count >= 2 && Opinion.Value != e.Opinion) )
            {
                //自らのイベントを発火
                OnOpinionChanged(e);
            }

            //順番大切!
            AddThought();
        }
        protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            EventHandler<OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #10
0
        protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.
            EventHandler<OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #11
0
 public void thought_OpinionChanged(object sender, OpinionEventArgs e)
 {
     NotifyOthers(e.Opinion);
     OnOpinionChanged(e);
 }
Exemple #12
0
        void thought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            //この段階では、前の段階のOpinionがある
            //thoughtStack.CurrentThought.Opinion

            NotifyOthers( e.Opinion );

            //自信のイベントも連鎖して発火
            OnOpinionChanged(e);

            //コノ後、新しい意見が積み重なってしまうので注意。
            //気を配らなきゃいけないのめんどくさいので設計ヨクない
        }