fix: add new event properties to builder

This commit is contained in:
punchready 2021-05-05 18:58:39 +02:00
parent 56a90f6bdf
commit a9c80cb19b
2 changed files with 14 additions and 2 deletions

View File

@ -41,7 +41,9 @@ public class EventBuilder {
// Keys used primarily in GameStateEvents
private Entity[] entities;
private EntityID[] turnOrder;
private IntVector2 mapSize;
private EntityID activeCharacter;
private Integer[] stoneCooldowns;
private Boolean winCondition;
// Keys used in CustomEvents
@ -145,11 +147,21 @@ public class EventBuilder {
return this;
}
public EventBuilder withMapSize(IntVector2 mapSize) {
this.mapSize = mapSize;
return this;
}
public EventBuilder withActiveCharacter(EntityID activeCharacter) {
this.activeCharacter = activeCharacter;
return this;
}
public EventBuilder withStoneCooldowns(Integer[] stoneCooldowns) {
this.stoneCooldowns = stoneCooldowns;
return this;
}
public EventBuilder withWinCondition(Boolean winCondition) {
this.winCondition = winCondition;
return this;

View File

@ -11,9 +11,9 @@ import java.util.Objects;
public class GameStateEvent extends Event {
public Entity[] entities;
public EntityID[] turnOrder;
public IntVector2 mapSize; // Stores the map size, for example for a 10x15 map [9,14] (starting from 0)
public IntVector2 mapSize;
public EntityID activeCharacter;
public Integer[] stoneCooldowns; // Int[6]
public Integer[] stoneCooldowns;
public Boolean winCondition;
@Override