Closed russella26 closed 2 years ago
actually, i'd love to see a second opinion on this, i can't see a reason why comparing simply by reference would be unsafe
Comparing by reference covers checking if two Tiles are the exact same Tile. But it doesn't cover if you want to check if two different tiles have the same entities. So if we plan on checking for having the same entities (which doesn't really make much sense) then we should but otherwise there is no reason to since the Positions will be unique anyways, I think.
We should also consider tile Type. Ex.) A wall, water, a regular passable floor. I think these should definitely be added.
Fixed in a direct push.
Override the equals function for tiles. If you're confused, look at Position.java for a well done implementation.