
// Command.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th


/* This class holds information about a command that was issued by the user.
 * A command consists of two strings: (e.g.  "go" and "south").
 * 
 * If the user entered an invalid command (a word that is not
 * known) then the first word is <null>.
 * The second word may also be <null>.
 * 
 * @author  Michael Kolling and David J. Barnes
 * @version 2006.03.30
*/

public class Command
{
  private String firstWord;
  private String secondWord;


  public Command(String fstWord, String secWord)
  { firstWord = fstWord;
    secondWord = secWord;
  }

  public String getFirstWord()
  {  return firstWord;  }

  public String getSecondWord()
  {  return secondWord;  }

  public boolean isUnknown()
  {  return (firstWord == null);  }

  public boolean hasSecondWord()
  {  return (secondWord != null); }

}  // end of Command class

