Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckTaoYi improve readability, add config.yml to adjust "escaped max distance" #3

Open
YOM667 opened this issue Feb 20, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@YOM667
Copy link
Member

YOM667 commented Feb 20, 2024

Improve Readability

i fix a shit code in CheckTaoYi Command

 public boolean checkDistance(TeamExecutor.Team team, int max, BiConsumer<TeamExecutor.Team,Boolean> success){
        if (team == TeamExecutor.Team.NONE){
            return false;
        } else {
            TeamExecutor.Team enemyTeam = teamExecutor.getEnemyTeam(team);
            int distance = (int) teamExecutor.getPlayer(enemyTeam)
                    .getLocation()
                    .distance(teamExecutor.getStartGameLocation().get(enemyTeam));
            success.accept(enemyTeam,Math.abs(distance) > max);
        }
        return true;
}

the contributer use functional interface BiConsumer<TeamExecutor.Team,Boolean> is bad
YouM is shit coder
i fixed it to improve readability

Configuration

i add config, user can use config.yml to update escaped max distance

please accept my pull requests

@YOM667 YOM667 added the enhancement New feature or request label Feb 20, 2024
@YOM667
Copy link
Member Author

YOM667 commented Feb 20, 2024

thanks, I agree with you about YouM is shit coder
X_huihui will merge your pr please wait some times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants