StevensSEC / pokemonbattlelib

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

RFC: API Change for Targets #368

Closed adapap closed 3 years ago

adapap commented 3 years ago

*Not working on refactoring tests until there is a consensus on API changes

This PR proposes a new API based around the fact that target structs will be passed around, which are simply a composite key of (party, slot) of an active? Pokemon. The reasons for this proposal include:

Potential/only? drawback:

Summary of API changes

Removed the following helper methods as they are redundant, replaced, or otherwise disposable:

Closes #362

dyc3 commented 3 years ago

It would be a good idea to at least refactor the test in agent_test to make sure you're making deep copies.

Can you give an example of what an Agent implementation would look like now? Try the smarterAgent in benchmark_test

adapap commented 3 years ago

@dyc3 Modified a chunk of tests, and the example in benchmark, to use the new API. Not much actually has to change on the implementation end - the benefits are mostly internal organization.

I want to double check that the copy is actually a copy passed to agents if you could verify that.