From d9f88b8eef2a1f8c8378913b9751bd9ef6638319 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Fri, 27 Dec 2013 14:16:08 -0600 Subject: [PATCH] Add some documentation to the prepareJail method. --- .../com/graywolf336/jail/PrisonerManager.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/graywolf336/jail/PrisonerManager.java b/src/main/java/com/graywolf336/jail/PrisonerManager.java index 9bc7079..b000601 100644 --- a/src/main/java/com/graywolf336/jail/PrisonerManager.java +++ b/src/main/java/com/graywolf336/jail/PrisonerManager.java @@ -19,6 +19,21 @@ public class PrisonerManager { /** * Prepare the jailing of this player. * + *

+ * + * In this we do the following: + *

    + *
  1. Checks if the jail is null, if so it throws an Exception
  2. + *
  3. Checks if the prisoner is null, if so it throws an Exception
  4. + *
  5. Sets the prisoner data to offline pending or not, player == null
  6. + *
  7. If the cell is null, add the prisoner data to the jail otherwise we set the cell's prisoner to this one. Check before here if the cell already contains a prisoner.
  8. + *
  9. Saves the jail information, goes out to the {@link JailIO} to initate a save.
  10. + *
  11. If the prisoner is not offline, we will actually {@link #jailPrisoner(Jail, Cell, Player, Prisoner) jail} them now.
  12. + *
  13. Does checks to get the right message for the next two items.
  14. + *
  15. If we broadcast the jailing, then let's broadcast it.
  16. + *
  17. If we log the jailing to console and we haven't broadcasted it, then we log it to the console.
  18. + *
+ * * @param jail The jail instance we are sending this prisoner to * @param cell The name of the cell we are sending this prisoner to * @param player The player we are preparing the jail for. @@ -40,7 +55,7 @@ public class PrisonerManager { if(cell == null) { jail.addPrisoner(prisoner); }else { - jail.getCell(cell.getName()).setPrisoner(prisoner); + cell.setPrisoner(prisoner); } //Save the jail after adding them to the jail @@ -139,5 +154,12 @@ public class PrisonerManager { player.getPassenger().eject(); player.eject(); } + + //If the cell doesn't equal null, then let's put them in the jail + if(cell != null) { + + }else { + //There is no cell we're jailing them to, so stick them in the jail + } } }