manny405 / sapai

Super auto pets engine built with reinforment learning training in mind
MIT License
67 stars 21 forks source link

`__eq__` for Pet, Team, Shop, Player #15

Open alexdriedger opened 2 years ago

alexdriedger commented 2 years ago

The compress / decompress methods provide good ways to check for equality. However, in situations where the objects do not need to be compressed (eg. unit tests), equality methods are an easier way to check for equality. Additionally, this allows == to be used on these objects, which is probably more accessible to newer developers using the library

manny405 commented 2 years ago

This depends on the exact definition of equality. In the current code base, there are many checks for equality which are only seeing if two objects are actually the same object (meaning that they making the same memory reference).

If equality of the health, stats, status, etc. is desired, would it be possible to check if their string representations are identical?