コード例 #1
0
ファイル: ThoughtStack.cs プロジェクト: udonka/OpinionSharing
        protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            EventHandler <OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
ファイル: ThoughtStack.cs プロジェクト: udonka/OpinionSharing
        //現在の考えが意見を形成したら。
        private void CurrentThought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            if (thoughts.Count < 2 || (thoughts.Count >= 2 && Opinion.Value != e.Opinion))
            {
                //自らのイベントを発火
                OnOpinionChanged(e);
            }


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

            NotifyOthers(e.Opinion);

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


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

            //順番大切!
            AddThought();
        }
コード例 #9
0
ファイル: ThoughtStack.cs プロジェクト: udonka/OpinionSharing
        protected virtual void OnOpinionChanged(OpinionEventArgs e)
        {
            EventHandler<OpinionEventArgs> handler = OpinionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #10
0
ファイル: Thought.cs プロジェクト: udonka/OpinionSharing
        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);
            }
        }
コード例 #11
0
ファイル: AAT.cs プロジェクト: udonka/OpinionSharing
 public void thought_OpinionChanged(object sender, OpinionEventArgs e)
 {
     NotifyOthers(e.Opinion);
     OnOpinionChanged(e);
 }
コード例 #12
0
ファイル: SubOpinion.cs プロジェクト: udonka/OpinionSharing
        void thought_OpinionChanged(object sender, OpinionEventArgs e)
        {
            //この段階では、前の段階のOpinionがある
            //thoughtStack.CurrentThought.Opinion

            NotifyOthers( e.Opinion );

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

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