Package org.kikikan.deadbymoonlight.game
Class Generator
- java.lang.Object
-
- org.kikikan.deadbymoonlight.game.WorldObject
-
- org.kikikan.deadbymoonlight.game.Generator
-
public final class Generator extends WorldObject
Represents a Generator.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bukkit.inventory.Inventory
getInventory()
int
getMaxProgress()
Returns the maximum amount of progress.double
getProgress()
Gets the repair progress.java.util.ArrayList<Survivor>
getRepairing()
Gets a copy of the List of the Survivors who are repairing this Generator.boolean
isDone()
Checks if this Generator is repaired.boolean
isEnabled()
Checks if this Generator is enabled and can be interacted with.boolean
isRegressing()
Checks if the Generator is currently regressing.void
kickSurvivors()
Kicks the Survivors off the Generator.void
regressProgress(double multiplier)
Regresses the Generator with the specified value.void
regressStart(double amount, double multiplier)
Starts the regression.void
setAuraVisibility(org.bukkit.entity.Player player, boolean visible)
void
setEnabled(boolean value)
Enables or disables the Generator.-
Methods inherited from class org.kikikan.deadbymoonlight.game.WorldObject
equals, getGame, getLocation, hashCode
-
-
-
-
Method Detail
-
getInventory
public org.bukkit.inventory.Inventory getInventory()
-
getRepairing
public java.util.ArrayList<Survivor> getRepairing()
Gets a copy of the List of the Survivors who are repairing this Generator.- Returns:
- A list of the Survivors who are repairing this Generator.
-
setAuraVisibility
public void setAuraVisibility(org.bukkit.entity.Player player, boolean visible)
-
regressStart
public void regressStart(double amount, double multiplier)
Starts the regression.- Parameters:
amount
- The amount of progress subtracted before staring the regression progress.multiplier
- The multiplier of the regression itself. 1 = the normal regression speed; 2 - twice as fast; 0.5 two times slower than usual...
-
regressProgress
public void regressProgress(double multiplier)
Regresses the Generator with the specified value.- Parameters:
multiplier
- Subtracts this much from the Generator's progress.
-
isRegressing
public boolean isRegressing()
Checks if the Generator is currently regressing.- Returns:
- True if it is regressing.
-
isDone
public boolean isDone()
Checks if this Generator is repaired.- Returns:
- True if it is repaired.
-
getMaxProgress
public int getMaxProgress()
Returns the maximum amount of progress.- Returns:
- The amount of progress needed to repair this Generator.
-
kickSurvivors
public void kickSurvivors()
Kicks the Survivors off the Generator.
-
getProgress
public double getProgress()
Gets the repair progress.- Returns:
- The repair progress.
-
isEnabled
public boolean isEnabled()
Checks if this Generator is enabled and can be interacted with.- Returns:
- True if it is enabled.
-
setEnabled
public void setEnabled(boolean value)
Enables or disables the Generator. Disabled Generators cannot be interacted by anyone.- Parameters:
value
- Enabled or not.
-
-