DepositEvent first (#811)

* Update EventType.java

* Update InputHandler.java
This commit is contained in:
키에르
2019-10-11 13:35:29 +09:00
committed by Anuken
parent 204332a76a
commit f01e486edb
2 changed files with 8 additions and 2 deletions

View File

@@ -132,7 +132,13 @@ public class EventType{
/** Called when a player deposits items to a block.*/
public static class DepositEvent{
public final Tile tile;
public final Player player;
public DepositEvent(Tile tile, Player player){
this.tile = tile;
this.player = player;
}
}
public static class GameOverEvent{

View File

@@ -105,7 +105,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
int[] remaining = {accepted, accepted};
Block block = tile.block();
Events.fire(new DepositEvent());
Core.app.post(() -> Events.fire(new DepositEvent(tile, player)));
for(int i = 0; i < sent; i++){
boolean end = i == sent - 1;