open-dis / open-dis-java

Java implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7 :boom:
Other
44 stars 35 forks source link

Added hashCode() #79

Closed lcowan94 closed 3 years ago

lcowan94 commented 3 years ago

Added hasCode() to EntityID

leif81 commented 3 years ago

Thanks @lcowan94

I see the DIS6 EntityID class has a hashCode method, I wasn't familar with it until I went looking for it just now. I see it's a bit different and has a comment about why it was a certain way. Can you take a look. I wonder if we shouldn't copy the same for the DIS7 EntityID. Does it matter to you which implementation of hashCode we use here?

https://github.com/open-dis/open-dis-java/blob/5a8b914d4425f197e77d13ca3b88c8890953b81d/src/main/java/edu/nps/moves/dis/EntityID.java#L149

lcowan94 commented 3 years ago

I've added some tests for the equals and hashCode methods

leif81 commented 3 years ago

Thank-you @lcowan94 !