Start work on #3, confirming before deleting something major.
This commit is contained in:
parent
2036a311ac
commit
f6686fee8d
44
src/main/java/com/graywolf336/jail/beans/ConfirmPlayer.java
Normal file
44
src/main/java/com/graywolf336/jail/beans/ConfirmPlayer.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
14
src/main/java/com/graywolf336/jail/enums/Confirmation.java
Normal file
14
src/main/java/com/graywolf336/jail/enums/Confirmation.java
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user