StevensSEC / pokemonbattlelib

A portable library for accurately simulating Pokemon battles.
GNU General Public License v3.0
12 stars 2 forks source link

Damage Dealt Utility #321

Closed adapap closed 3 years ago

adapap commented 3 years ago

Adds DamageDealt([]Transaction, *Pokemon) uint and battle.getTarget(int, int) target helper methods. Started doing a test refactor, would like some input before I continue @dyc3. I am aiming to only change tests where checking for explicit targets is redundant (a.k.a. just comparing damage dealt).

closes #282

codecov[bot] commented 3 years ago

Codecov Report

Merging #321 (1d35c05) into main (8b849c5) will increase coverage by 0.0186%. The diff coverage is 100.0000%.

:exclamation: Current head 1d35c05 differs from pull request most recent head 41bfaf4. Consider uploading reports for the commit 41bfaf4 to get more accurate results Impacted file tree graph

@@               Coverage Diff                @@
##               main       #321        +/-   ##
================================================
+ Coverage   96.0624%   96.0810%   +0.0186%     
================================================
  Files            14         14                
  Lines          1473       1480         +7     
================================================
+ Hits           1415       1422         +7     
  Misses           46         46                
  Partials         12         12                
Impacted Files Coverage Δ
battle.go 93.1818% <100.0000%> (+0.1226%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8b849c5...41bfaf4. Read the comment docs.

dyc3 commented 3 years ago

does this close #282 ?

adapap commented 3 years ago

I think so. In my mind I had some idea where you pass in two battles and then compare the damage dealt with a matcher, but I think this is more appropriately handled in a setup/BeforeEach method, or potentially with a battle.Reset() method to easily compare two battles.

dyc3 commented 3 years ago

You could just do a deep copy of the battle to duplicate it