Previously, the autoplay directly switch from offensive to a defensive strategy when the ball was immobile and was our half of the field. The problem is that sometime we have a robot super close to the ball and no enemy near it, thus we don't to switch to a defensive strategy immediately.
I added a check that we can stay in offensive if and only if we have the closest robot to the ball and no enemy robot near it.
Previously, the autoplay directly switch from offensive to a defensive strategy when the ball was immobile and was our half of the field. The problem is that sometime we have a robot super close to the ball and no enemy near it, thus we don't to switch to a defensive strategy immediately. I added a check that we can stay in offensive if and only if we have the closest robot to the ball and no enemy robot near it.