Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdentityLinkedList purpose #11

Open
Kallin opened this issue Aug 25, 2014 · 3 comments
Open

IdentityLinkedList purpose #11

Kallin opened this issue Aug 25, 2014 · 3 comments

Comments

@Kallin
Copy link
Contributor

Kallin commented Aug 25, 2014

What is the purpose of using the IdentityLinkedList? I swapped it out for a regular linkedlist and noticed that just one test failed. It's fairly unusual to see an obscure data structure like this used, perhaps we could find another solution? Any light shed on the reason for its use would be appreciated!

@oyachai
Copy link
Owner

oyachai commented Aug 25, 2014

There can be multiple minions of the same type at once on the board. So, in order to distinguish the minions, the minions would either have to be individually id'ed or their board positions kept. Keeping their board positions updated is a lot of work because minion positions change all the time, and manually id'ing all minions with unique ids is wasteful because Java does that for you with object ids already.

I think the test that failed is the only test that has duplicate minions.

I'm not a great Java programmer though... so if you have an idea on how to improve it, I'd love to know.

@Kallin
Copy link
Contributor Author

Kallin commented Aug 26, 2014

Dude it's pretty great what you've created so far! I'm doing my best to grok what's there and I'll offer some pull requests soon to simplify things if possible.

@MrHen
Copy link
Contributor

MrHen commented Apr 8, 2015

FWIW, I added more explicit tests around the IdentityLinkedList support that highlight why it exists. The actual linked list implementation seems rather memory heavy so it may be worth looking into an alternative since we'll potentially have millions of instances at any given time.

But in the meantime, this issue can probably be closed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants