Rename stuff. Names are hard.

This commit is contained in:
Lymia Aluysia 2016-09-25 14:45:06 -05:00
parent 207cb04dbc
commit 48e14a1765
No known key found for this signature in database
GPG key ID: DB2E204C989251F7
5 changed files with 47 additions and 42 deletions

View file

@ -47,7 +47,7 @@ public class GameEvent implements Serializable {
protected String data;
protected Zone zone;
protected ArrayList<UUID> appliedEffects = new ArrayList<>();
protected UUID pluginEventType = null;
protected UUID customEventType = null;
public enum EventType {
@ -272,13 +272,13 @@ public class GameEvent implements Serializable {
COMBAT_DAMAGE_APPLIED,
SELECTED_ATTACKER, SELECTED_BLOCKER,
//custom events
PLUGIN_EVENT;
CUSTOM_EVENT;
}
private GameEvent(EventType type, UUID pluginEventType,
private GameEvent(EventType type, UUID customEventType,
UUID targetId, UUID sourceId, UUID playerId, int amount, boolean flag) {
this.type = type;
this.pluginEventType = pluginEventType;
this.customEventType = customEventType;
this.targetId = targetId;
this.sourceId = sourceId;
this.amount = amount;
@ -294,12 +294,12 @@ public class GameEvent implements Serializable {
this(type, null, targetId, sourceId, playerId, amount, flag);
}
public GameEvent(UUID pluginEventType, UUID targetId, UUID sourceId, UUID playerId) {
this(EventType.PLUGIN_EVENT, pluginEventType, targetId, sourceId, playerId, 0, false);
public GameEvent(UUID customEventType, UUID targetId, UUID sourceId, UUID playerId) {
this(EventType.CUSTOM_EVENT, customEventType, targetId, sourceId, playerId, 0, false);
}
public GameEvent(UUID pluginEventType, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean flag) {
this(EventType.PLUGIN_EVENT, pluginEventType, targetId, sourceId, playerId, amount, flag);
public GameEvent(UUID customEventType, UUID targetId, UUID sourceId, UUID playerId, int amount, boolean flag) {
this(EventType.CUSTOM_EVENT, customEventType, targetId, sourceId, playerId, amount, flag);
}
public static GameEvent getEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId, int amount) {
@ -321,20 +321,20 @@ public class GameEvent implements Serializable {
return event;
}
public static GameEvent getEvent(UUID pluginEventType, UUID targetId, UUID sourceId, UUID playerId, int amount) {
return new GameEvent(pluginEventType, targetId, sourceId, playerId, amount, false);
public static GameEvent getEvent(UUID customEventType, UUID targetId, UUID sourceId, UUID playerId, int amount) {
return new GameEvent(customEventType, targetId, sourceId, playerId, amount, false);
}
public static GameEvent getEvent(UUID pluginEventType, UUID targetId, UUID sourceId, UUID playerId) {
return new GameEvent(pluginEventType, targetId, sourceId, playerId);
public static GameEvent getEvent(UUID customEventType, UUID targetId, UUID sourceId, UUID playerId) {
return new GameEvent(customEventType, targetId, sourceId, playerId);
}
public static GameEvent getEvent(UUID pluginEventType, UUID targetId, UUID playerId) {
return new GameEvent(pluginEventType, targetId, null, playerId);
public static GameEvent getEvent(UUID customEventType, UUID targetId, UUID playerId) {
return new GameEvent(customEventType, targetId, null, playerId);
}
public static GameEvent getEvent(UUID pluginEventType, UUID targetId, UUID playerId, String data, int amount) {
GameEvent event = getEvent(pluginEventType, targetId, playerId);
public static GameEvent getEvent(UUID customEventType, UUID targetId, UUID playerId, String data, int amount) {
GameEvent event = getEvent(customEventType, targetId, playerId);
event.setAmount(amount);
event.setData(data);
return event;
@ -344,7 +344,9 @@ public class GameEvent implements Serializable {
return type;
}
public UUID getPluginEventType() { return pluginEventType; }
public UUID getCustomEventType() {
return customEventType;
}
public UUID getTargetId() {
return targetId;
@ -412,8 +414,8 @@ public class GameEvent implements Serializable {
return appliedEffects;
}
public boolean isPluginEvent(UUID pluginEventType) {
return type == EventType.PLUGIN_EVENT && this.pluginEventType.equals(pluginEventType);
public boolean isCustomEvent(UUID customEventType) {
return type == EventType.CUSTOM_EVENT && this.customEventType.equals(customEventType);
}
public void setAppliedEffects(ArrayList<UUID> appliedEffects) {