protected virtual void OnOpinionChanged(OpinionEventArgs e) { EventHandler <OpinionEventArgs> handler = OpinionChanged; if (handler != null) { handler(this, e); } }
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(); }
void thought_OpinionChanged(object sender, OpinionEventArgs e) { //この段階では、前の段階のOpinionがある //thoughtStack.CurrentThought.Opinion NotifyOthers(e.Opinion); //自信のイベントも連鎖して発火 OnOpinionChanged(e); //コノ後、新しい意見が積み重なってしまうので注意。 //気を配らなきゃいけないのめんどくさいので設計ヨクない }
public void thought_OpinionChanged(object sender, OpinionEventArgs e) { NotifyOthers(e.Opinion); OnOpinionChanged(e); }
void AgentOpinionChanged(object sender, OpinionEventArgs e) { //Console.WriteLine("opinion " + e.Opinion); }
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); } }
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); } }
public void thought_OpinionChanged(object sender, OpinionEventArgs e) { NotifyOthers(e.Opinion); OnOpinionChanged(e); }
void thought_OpinionChanged(object sender, OpinionEventArgs e) { //この段階では、前の段階のOpinionがある //thoughtStack.CurrentThought.Opinion NotifyOthers( e.Opinion ); //自信のイベントも連鎖して発火 OnOpinionChanged(e); //コノ後、新しい意見が積み重なってしまうので注意。 //気を配らなきゃいけないのめんどくさいので設計ヨクない }