private static void ShootAndRun(IPlayerApi api)
    {
        if (IsDodge())
        {
            if ((api.GetHealth() < 40) && (api.GetNumberofVisibleMedkits() > 0))
            {
                api.GetNearestMedkit();
                return;
            }

            if (api.GetNumberOfVisibleBazookas() > 0)
            {
                api.GetNearestBazooka();
            }
            else
            {
                api.MoveToRandomLocation();
            }

            return;
        }

        Shoot(api);

        _enemyPosition = api.GetEnemyPosition();
    }
 public void Think(IPlayerApi api)
 {
     if (!api.GetEnemySighted())
     {
         if ((api.GetHealth() < 100) && (api.GetNumberofVisibleMedkits() > 0))
         {
             api.GetNearestMedkit();
         }
         else
         {
             if ((api.GetAmmo() < 3) && (api.GetNumberOfVisibleBazookas() > 0))
             {
                 api.GetNearestBazooka();
             }
             else
             {
                 api.MoveToRandomLocation();
             }
         }
     }
     else
     {
         if ((api.GetHealth() < 40) && (api.GetNumberofVisibleMedkits() > 0))
         {
             api.GetNearestMedkit();
         }
         else
         {
             if (api.GetAmmo() == 0)
             {
                 api.Stop();
                 api.ShootBullet(api.GetEnemyPosition());
             }
             else
             {
                 api.Stop();
                 api.ShootRocket(api.GetEnemyPosition());
             }
         }
     }
 }
 private static void RunForItem(IPlayerApi api)
 {
     if ((api.GetHealth() < 100) && (api.GetNumberofVisibleMedkits() > 0))
     {
         api.GetNearestMedkit();
     }
     else
     {
         if ((api.GetAmmo() < 3) && (api.GetNumberOfVisibleBazookas() > 0))
         {
             api.GetNearestBazooka();
         }
         else
         {
             api.MoveToRandomLocation();
         }
     }
 }
 private static void RunForItem(IPlayerApi api)
 {
     if ((api.GetHealth() < 100) && (api.GetNumberofVisibleMedkits() > 0))
     {
         api.GetNearestMedkit();
     }
     else
     {
         if ((api.GetAmmo() < 3) && (api.GetNumberOfVisibleBazookas() > 0))
         {
             api.GetNearestBazooka();
         }
         else
         {
             api.MoveToRandomLocation();
         }
     }
 }
    private static void ShootAndRun(IPlayerApi api)
    {
        if (IsDodge())
        {
            if ((api.GetHealth() < 40) && (api.GetNumberofVisibleMedkits() > 0))
            {
                api.GetNearestMedkit();
                return;
            }

            if (api.GetNumberOfVisibleBazookas() > 0)
            {
                api.GetNearestBazooka();
            }
            else
            {
                api.MoveToRandomLocation();
            }

            return;
        }

        Shoot(api);

        _enemyPosition = api.GetEnemyPosition();
    }