Closed adapap closed 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
@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.
*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
battle_round.go
target
is now defined asstruct{party: uint, slot: uint}
(negative indices will not occur!)target
objects instead of pointersmap[uint]uint
instead of a map to pointers to easily implementSwitchTurn
in the futureSelf()
,Allies()
,Opponents()
,Targets()
Removed the following helper methods as they are redundant, replaced, or otherwise disposable:
battle.getPokemonInBattle
battle.getTarget
battle.GetTargetsRef
battle.getContext
,battle.GetRoundContext
renamed tobattle.GetBattleContext
battleParty.GetActivePokemon
(this one might be needed still or replaced)Closes #362