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

View File

@ -11,9 +11,9 @@ import java.util.Objects;
public class GameStateEvent extends Event { public class GameStateEvent extends Event {
public Entity[] entities; public Entity[] entities;
public EntityID[] turnOrder; 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 EntityID activeCharacter;
public Integer[] stoneCooldowns; // Int[6] public Integer[] stoneCooldowns;
public Boolean winCondition; public Boolean winCondition;
@Override @Override