コード例 #1
0
 protected virtual void OnAgentMoved(AgentMovedEventArgs e)
 {
     EventHandler<AgentMovedEventArgs> eh = this.AgentMoved;
     if (eh != null)
         eh(this, e);
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Firtzberg/AI-WumpusWorld
 void WW_AgentMoved(object sender, AgentMovedEventArgs e)
 {
     KB.Move(e.Direction, WW.Breeze, WW.Stench, WW.Glitter);
     this.splitContainer1.Panel2.AutoScrollPosition = new Point(
         WW.AgentPositionX * WW.SquareDimension - this.splitContainer1.Panel2.Width / 2 + WW.SquareDimension / 2,
         (WW.Columns - WW.AgentPositionY - 1) * WW.SquareDimension - this.splitContainer1.Panel2.Height / 2 + WW.SquareDimension / 2);
     Uspjesnost--;
     lblUspjesnost.Text = Uspjesnost.ToString();
     if (AgentIgra)
         WW.AgentMove(KB.BestMove());
 }