示例#1
0
 private void HandleCastleMovement()
 {
     for (int i = 0; i < castleList.Count; i++)
     {
         Castle castle = castleList[i];
         bool   isToTheRightOfDragon = castle.GetXposition() > DragonPosition;
         castle.Move();
         if (isToTheRightOfDragon && castle.GetXposition() <= DragonPosition && castle.IsBottom())
         {
             castlePassedCount++;
         }
         if (castle.GetXposition() < destroyPosition)
         {
             castle.DestroySelf();
             castleList.Remove(castle);
             i--;
         }
     }
 }