diff --git a/src/intents/FactionIntent.java b/src/intents/FactionIntent.java new file mode 100644 index 00000000..ae465b6e --- /dev/null +++ b/src/intents/FactionIntent.java @@ -0,0 +1,47 @@ +package intents; + +import resources.PvpFaction; +import resources.control.Intent; +import resources.objects.tangible.TangibleObject; + +public class FactionIntent extends Intent { + + public static final String TYPE = "FactionIntent"; + private TangibleObject target; + private PvpFaction newFaction; + private FactionIntentType updateType; + + private FactionIntent(TangibleObject target) { + super(TYPE); + this.target = target; + } + + public FactionIntent(TangibleObject target, FactionIntentType updateType) { + this(target); + this.updateType = updateType; + } + + public FactionIntent(TangibleObject target, PvpFaction newFaction) { + this(target, FactionIntentType.FACTIONUPDATE); + this.newFaction = newFaction; + } + + public TangibleObject getTarget() { + return target; + } + + public PvpFaction getNewFaction() { + return newFaction; + } + + public FactionIntentType getUpdateType() { + return updateType; + } + + public enum FactionIntentType { + FLAGUPDATE, + STATUSUPDATE, + FACTIONUPDATE // Is automatically set in the correct constructor, don't use manually. + } + +} \ No newline at end of file diff --git a/src/resources/PvpFaction.java b/src/resources/PvpFaction.java new file mode 100644 index 00000000..3e017f0e --- /dev/null +++ b/src/resources/PvpFaction.java @@ -0,0 +1,21 @@ +package resources; + +import resources.common.CRC; + +public enum PvpFaction { + + NEUTRAL(0), + IMPERIAL(CRC.getCrc("imperial")), + REBEL(CRC.getCrc("rebel")); + + private int crc; + + PvpFaction(int crc) { + this.crc = crc; + } + + public int getCrc() { + return crc; + } + +} \ No newline at end of file diff --git a/src/resources/PvpFlag.java b/src/resources/PvpFlag.java new file mode 100644 index 00000000..e010db11 --- /dev/null +++ b/src/resources/PvpFlag.java @@ -0,0 +1,25 @@ +package resources; + +public enum PvpFlag { + + ATTACKABLE(1<<0), + AGGRESSIVE(1<<1), + OVERT(1<<2), + TEF(1<<3), + PLAYER(1<<4), + ENEMY(1<<5), + GOING_OVERT(1<<6), + GOING_COVERT(1<<7), + DUEL(1<<8); + + private int bitmask; + + PvpFlag(int bitmask) { + this.bitmask = bitmask; + } + + public int getBitmask() { + return bitmask; + } + +} \ No newline at end of file diff --git a/src/resources/PvpStatus.java b/src/resources/PvpStatus.java new file mode 100644 index 00000000..bde504fc --- /dev/null +++ b/src/resources/PvpStatus.java @@ -0,0 +1,19 @@ +package resources; + +public enum PvpStatus { + + ONLEAVE(0), + COMBATANT(1), + SPECIALFORCES(2); + + private int value; + + PvpStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + +} \ No newline at end of file