ArrayList to check
Posted: Wed Feb 18, 2015 2:47 am
Hello,
e.g. character have these buffs in arraylist which will be added if he press button x,a,b etc.
List <Integer> _buffs = new ArrayList<>();
_buffs.add(100);
_buffs.add(101);
_buffs.add(102);
how to check how much he have buffs which ids are 101 and 102?
because if _buffs.size(); it will returns all hes buffs count, but I need only e.g. 101 and 102.
also _buffs.contains don't need for me, because it is boolean, I need int...
Thanks,
Bencratus
e.g. character have these buffs in arraylist which will be added if he press button x,a,b etc.
List <Integer> _buffs = new ArrayList<>();
_buffs.add(100);
_buffs.add(101);
_buffs.add(102);
how to check how much he have buffs which ids are 101 and 102?
because if _buffs.size(); it will returns all hes buffs count, but I need only e.g. 101 and 102.
also _buffs.contains don't need for me, because it is boolean, I need int...
Thanks,
Bencratus