document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  
  2. /**
  3.  * Kelas ini adalah kelas utama dari aplikasi "World of Zuul".
  4.  * "World of Zuul" adalah game petualangan berbasis teks yang sangat sederhana.
  5.  *
  6.  * Kelas ini menyimpan informasi tentang perintah yang dikeluarkan oleh pengguna.
  7.  * Perintah saat ini terdiri dari dua string: kata perintah dan kedua
  8.  * kata (misalnya, jika perintahnya "take map", maka dua string
  9.  * jelas adalah "take" dan "map").
  10.  *
  11.  * Cara menggunakannya adalah: Perintah sudah diperiksa validitasnya
  12.  * kata perintah. Jika pengguna memasukkan perintah yang tidak valid (kata yang tidak
  13.  * Diketahui) maka kata perintahnya adalah <null>.
  14.  *
  15.  * Jika perintah hanya memiliki satu kata, maka kata kedua adalah <null>.
  16.  *
  17.  * @author  Muhammad Bagus Istighfar
  18.  * @version 0.1 - 17 November 2020
  19.  */
  20. public class Command
  21. {
  22.     private String commandWord;
  23.     private String secondWord;
  24.  
  25.     /**
  26.      * Create a command object. First and second word must be supplied, but
  27.      * either one (or both) can be null. The command word should be null to
  28.      * indicate that this was a command that is not recognised by this game.
  29.      * @param String firstWord
  30.      * @param String secondWord
  31.      */
  32.     public Command(String firstWord, String secondWord)
  33.     {
  34.         commandWord = firstWord;
  35.         this.secondWord = secondWord;
  36.     }
  37.  
  38.     /**
  39.      * Return the command word (the first word) of this command. If the
  40.      * command was not understood, the result is null.
  41.      * @return String commandWord
  42.      */
  43.     public String getCommandWord()
  44.     {
  45.         return commandWord;
  46.     }
  47.  
  48.     /**
  49.      * Return the second word of this command. Returns null if there was no
  50.      * second word.
  51.      * @return String secondWord
  52.      */
  53.     public String getSecondWord()
  54.     {
  55.         return secondWord;
  56.     }
  57.  
  58.     /**
  59.      * Return true if this command was not understood.
  60.      * @return bool
  61.      */
  62.     public boolean isUnknown()
  63.     {
  64.         return (commandWord == null);
  65.     }
  66.  
  67.     /**
  68.      * Return true if the command has a second word.
  69.      * @return bool
  70.      */
  71.     public boolean hasSecondWord()
  72.     {
  73.         return (secondWord != null);
  74.     }
  75. }
  76.  
');