diff --git a/src/main/java/com/graywolf336/jail/beans/ConfirmPlayer.java b/src/main/java/com/graywolf336/jail/beans/ConfirmPlayer.java new file mode 100644 index 0000000..f76a817 --- /dev/null +++ b/src/main/java/com/graywolf336/jail/beans/ConfirmPlayer.java @@ -0,0 +1,44 @@ +package com.graywolf336.jail.beans; + +import com.graywolf336.jail.enums.Confirmation; + +/** + * Holds data for when a player is confirming a command. + * + * @author graywolf336 + * @version 1.0.0 + * @since 3.0.0 + */ +public class ConfirmPlayer { + private String name; + private String[] args; + private Confirmation confirm; + private Long expires; + + public ConfirmPlayer(String name, String[] args, Confirmation confirm) { + this.name = name; + this.args = args; + this.confirm = confirm; + this.expires = System.currentTimeMillis() + 5000L; + } + + /** Returns the name of the thing needing to confirm. */ + public String getName() { + return this.name; + } + + /** Returns the inital arguments they sent with their command. */ + public String[] getArguments() { + return this.args; + } + + /** Returns what they are {@link Confirmation confirming}. */ + public Confirmation getConfirming() { + return this.confirm; + } + + /** Returns the time in milliseconds their confirmation time frame expires. */ + public Long getExpiryTime() { + return this.expires; + } +} diff --git a/src/main/java/com/graywolf336/jail/enums/Confirmation.java b/src/main/java/com/graywolf336/jail/enums/Confirmation.java new file mode 100644 index 0000000..6336ab1 --- /dev/null +++ b/src/main/java/com/graywolf336/jail/enums/Confirmation.java @@ -0,0 +1,14 @@ +package com.graywolf336.jail.enums; + +public enum Confirmation { + /** When they are clearing a jail from all their prisoner's with releasing properly. */ + CLEAR, + /** When they are clearing a jail from all their prisoner's by force. */ + CLEARFORCE, + /** When they are deleting a cell from a jail. */ + DELETECELL, + /** When they are deleting all a jail's cells. */ + DELETECELLS, + /** When they are deleting a jail. */ + DELETE; +}