package uk.co.patrickhaston.mars;

// The MarsResponse class is used to describe a response
// that a character in the game makes to the user.
// The actual response given to a Statement depends on the
// personality of the character and the character's mood.
// A possibility for future consideration would be to take into
// account the relationship between the character and the
// person they are conversing with.

public class MarsResponse extends MarsData 
{
  //Response,NextStatement,Personality,Mood,Y/N,Text
  public String response;
  // The type of response that this fits into
  public int nextChoice;
  // The next list of statements to display for the user to choose
  public String personality;
  // D = dominant
  // I = inspirational
  // C = careful
  // S = sensible
  public String mood;
  // Happy, Ok or Angry are the only three options at this point
  public boolean agreement;
  // is the character in agreement with the user?
  public String theText;
  // what the character actually says.
  
  public MarsResponse(int id)
  {
    super(id);
    response = "";
    nextChoice = 0;
    personality = "";
    mood = "";
    agreement = false;
    theText = "";
  }

  public MarsResponse(MarsResponse r)
  {
    super(r);
    if( r != null )
    {
      response = r.response;
      nextChoice = r.nextChoice;
      personality = r.personality;
      mood = r.mood;
      agreement = r.agreement;
      theText = r.theText;
    }
    else
    {
      response = "";
      nextChoice = 0;
      personality = "";
      mood = "";
      agreement = false;
      theText = "";
    }
  }
  
  public MarsResponse(String line)
  {
    super(line);
    response = readString(line, 0);
    nextChoice = readInteger(line, 1);
    personality = readString(line, 2);
    mood = readString(line, 3);
    agreement = readBoolean(line, 4);
    theText = readString(line, 5);
  }

  public String toString()
  {
    return theText;
  }
}
