-
Notifications
You must be signed in to change notification settings - Fork 571
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
Update CreatureEvaluator.java #6445
base: master
Are you sure you want to change the base?
Conversation
Break down the evaluation logic into smaller methods. Add comments to explain the purpose of each section. Add logging for debugging purposes. Implement a method to print the evaluation details for better insight.
} | ||
|
||
// TODO no longer a KW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not remove any unaddressed TODO or otherwise useful comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like a few other ones are still being removed
} | ||
if (c.hasKeyword(Keyword.VANISHING)) { | ||
value -= subValue(20 / (Math.max(1, c.getCounters(CounterEnumType.TIME))), "vanishing"); | ||
value += subValue(20 / (Math.max(1, c.getCounters(CounterEnumType.TIME))), "vanishing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do believe this breaks and would just increase now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't the -
be moved inside the addValue call instead so the debug output in SimulationCreatureEvaluator
will be correct?
} else if (c.getSVar("SacrificeEndCombat").equals("True")) { | ||
value -= subValue(40, "sac-end"); | ||
value += subValue(40, "sac-end"); | ||
} | ||
if (c.hasKeyword("CARDNAME can't attack or block.")) { | ||
value = addValue(50 + (c.getCMC() * 5), "useless"); // reset everything - useless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of your splitting this reset is broken now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your ideas
However this seems to be a bit more than a simple refactor and needs more care
Retained Unaddressed TODO Comment: Fixed the incorrect addition logic for the vanishing keyword to ensure it subtracts value correctly Corrected the section where the reset logic for useless cards was broken due to splitting Removed comments that only spell out the function name again, as they don't add additional information
i have made the neccessary changes please give it a look and if further changes are required you can let me know |
Break down the evaluation logic into smaller methods.
Add comments to explain the purpose of each section.
Add logging for debugging purposes.
Implement a method to print the evaluation details for better insight.