Changed selections to not use enum

This commit is contained in:
Sekwah 2018-07-13 01:41:07 +01:00
parent 55f5d57314
commit 1a93c7a081
3 changed files with 9 additions and 15 deletions

View File

@ -1,6 +0,0 @@
package com.sekwah.advancedportals.core.enums;
public enum EnumHandSelection {
LEFTHAND,
RIGHTHAND
}

View File

@ -12,9 +12,9 @@ public interface PortalTempDataRepository {
void removeSelectedPortal(UUID uuid);
void addSelectedHand(UUID uuid, EnumHandSelection enumHandSelection, PortalLocation portalLocation);
void addSelectedPosition(UUID uuid, boolean isPos1, PortalLocation portalLocation);
void removeSelectedHand(UUID uuid, EnumHandSelection enumHandSelection);
void removeSelectedPosition(UUID uuid, boolean isPos1);
void removeAllSelectedHand(UUID uuid);

View File

@ -20,7 +20,7 @@ public class PortalTempDataRepositoryImpl implements PortalTempDataRepository {
.expireAfterAccess(30, TimeUnit.DAYS)
.build();
Table<UUID, EnumHandSelection, PortalLocation> selectedHand = HashBasedTable.create();
Table<UUID, Boolean, PortalLocation> selectedPositions = HashBasedTable.create();
@Override
public void addSelectedPortal(UUID selectedPlayer, String portal) {
@ -33,19 +33,19 @@ public class PortalTempDataRepositoryImpl implements PortalTempDataRepository {
}
@Override
public void addSelectedHand(UUID uuid, EnumHandSelection enumHandSelection, PortalLocation portalLocation) {
selectedHand.put(uuid, enumHandSelection, portalLocation);
public void addSelectedPosition(UUID uuid, boolean isPos1, PortalLocation portalLocation) {
selectedPositions.put(uuid, isPos1, portalLocation);
}
@Override
public void removeSelectedHand(UUID uuid, EnumHandSelection enumHandSelection) {
selectedHand.remove(uuid, enumHandSelection);
public void removeSelectedPosition(UUID uuid, boolean isPos1) {
selectedPositions.remove(uuid, isPos1);
}
@Override
public void removeAllSelectedHand(UUID uuid) {
selectedHand.remove(uuid, EnumHandSelection.LEFTHAND);
selectedHand.remove(uuid, EnumHandSelection.RIGHTHAND);
selectedPositions.remove(uuid, EnumHandSelection.LEFTHAND);
selectedPositions.remove(uuid, EnumHandSelection.RIGHTHAND);
}
@Override