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

Refactor and fix logging of ToTeamByDispersal #89

Open
PapaCharlie9 opened this issue Aug 29, 2014 · 0 comments
Open

Refactor and fix logging of ToTeamByDispersal #89

PapaCharlie9 opened this issue Aug 29, 2014 · 0 comments

Comments

@PapaCharlie9
Copy link
Owner

Each of the three cases where dispersal is calculated should be refactored into a separate function, so that the goto's can be removed.

Also, the log lines needs to fixed so that the current player is not removed from the count. For example, for rank dispersal:

        String a = rankers[1] + "/" + rankers[2];
        if (isSQDM) a = a + "/" + rankers[3] + "/" + rankers[4];
        DebugWrite("^9(DEBUG) ToTeamByDispersal: analysis of ^b" + name + "^n dispersal of rank >= " + perMode.DisperseEvenlyByRank + ": " + a, 5);

Since this log line happens before rankers is used to select the target team, the log line would have to be moved after and the player added back to the team count they belong to before the string is constructed, something like:

         int pTeam = ... get players's team ...;
         rankers[pTeam] += 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant