コード例 #1
0
        private void ChFear()
        {
            Point antCentre = SupportFunc.getCentre(ThisAnt.Location, ThisAnt.Width, ThisAnt.Height);

            if (SupportFunc.InRadius(antCentre, Enemy, Visibility))
            {
                IsFear     = true;
                Target     = Enemy;
                TargetLeaf = null;
                return;
            }
            IsFear = false;
        }
コード例 #2
0
 private Control FoundLeaf()
 {
     foreach (Control leaf in Leafs)
     {
         if (!leaf.Enabled)
         {
             continue;
         }
         Point antCentre  = SupportFunc.getCentre(ThisAnt.Location, ThisAnt.Width, ThisAnt.Height);
         Point leafCentre = SupportFunc.getCentre(leaf.Location, leaf.Width, leaf.Height);
         if (SupportFunc.InRadius(antCentre, leafCentre, Visibility))
         {
             return(leaf);
         }
     }
     return(null);
 }