084180d10b9cb4ae4a4c5b895b95c2a44fdb00f8
1 package ru
.deadsoftware
.cavedroid
.game
.objects
;
3 import ru
.deadsoftware
.cavedroid
.game
.GameScope
;
4 import ru
.deadsoftware
.cavedroid
.game
.model
.item
.Item
;
6 import javax
.inject
.Inject
;
7 import java
.io
.Serializable
;
8 import java
.util
.Iterator
;
9 import java
.util
.LinkedList
;
12 public class DropController
implements Serializable
{
14 public interface Callback
{
18 private final LinkedList
<Drop
> mDrops
= new LinkedList
<>();
21 public DropController() {
24 public void addDrop(float x
, float y
, Item item
) {
25 mDrops
.add(new Drop(x
, y
, item
));
28 public int getSize() {
32 public void forEach(Callback callback
) {
33 mDrops
.forEach(callback
::run
);
36 public Iterator
<Drop
> getIterator() {
37 return mDrops
.iterator();