0e4c6592abe3badac802872be953ab84c68b2324
1 package ru
.deadsoftware
.cavedroid
.game
.objects
;
3 import ru
.deadsoftware
.cavedroid
.game
.GameScope
;
5 import javax
.inject
.Inject
;
6 import java
.io
.Serializable
;
7 import java
.util
.Iterator
;
8 import java
.util
.LinkedList
;
11 public class DropController
implements Serializable
{
13 public interface Callback
{
17 private final LinkedList
<Drop
> mDrops
= new LinkedList
<>();
20 public DropController() {
23 public void addDrop(float x
, float y
, int id
) {
24 mDrops
.add(new Drop(x
, y
, id
));
27 public int getSize() {
31 public void forEach(Callback callback
) {
32 mDrops
.forEach(callback
::run
);
35 public Iterator
<Drop
> getIterator() {
36 return mDrops
.iterator();