0
Right now I’m playing a card game, in which each Player has an inventory of his Cards.
I am now trying to create a Deck and my goal is to make the Cards that are already in the Deck not appear on the inventory side so I tried using the following and code:
for (HashMap<String, String> cartaInventario : listaCartasInventario) {
for (HashMap<String, String> cartaDeckInventario : listaCartasDeckInventario) {
if(cartaInventario.get(Config.TAG_ID_CARTA_INVENTARIO) != cartaDeckInventario.get(Config.TAG_ID_CARTA_DECKINVENTARIO))
{
cartasInventario.add(cartaInventario.get(Config.TAG_ID_CARTA_INVENTARIO));
}
}
}
This code does not yet work, my question is whether there is any other more effective way to do this check such as using lambda Expressions.
Hello, post the code in the question and not a print. There is an option to insert the code.
– renanvm
I’m sorry, my mistake
– Gonçalo Coelho