I am creating simple (for now
) game (for learning purpose) and would like to ask you for advise.
I would like to ask you which collection type should i use.
I have LinkedList named Isradimai (Inventions) which contains all Isradimas (Invention) type objects. (For now it only contains 20 but later it could contain 100-400 objects). Also there is another LinkedList named Ismintis (Wisdom) which contains only discovered inventions (Isradimas objects). And there also is 2 more LinkedLists named galimiIsradimai (available inventions) and galimiDarbai(available jobs). GalimiIsradimai contains only new discoverable Isradimas object and are show to player to pick new invention. GalimiIsradimai are populated by cloning Isradimai and then removing all that are contained in Ismintis. Then i iterate over it and examine each object to see if it fits needed requirements. If it fails it is removed. Each time player "invents" new invention i clear and repopulate galimiIsradimai and player have a new list of possible inventions it also clears and repopulates galimiDarbai.
GalimiDarbai contains all available actions for player. Sometimes inventing new inventions unlocks new actions for player to perform.That list is populated by iterating over Ismintis "and" Darbai (HashMap). If Isradimas object (contained in Ismintis) unlocks new action i look in HashMap and put received Darbas object in galimiDarbai.
Everything works very well. But one day i got idea that it could be better to replace all LinkedList to HashMap. So what do you think?
If you see some flaws in my design please post them too
Thanks in advance.
P.S. Sorry if i made some mistakes