package uk.co.patrickhaston.mars;

public class MarsGoal extends MarsData 
{
  // Contents
  public int role;
  public int step;
  public int activity;
  public int special;
  public String description;
  
  public MarsGoal(int id)
  {
    super(id);
    role = 0;
    step = 0;
    activity = 0;
    special = 0;
    description= "";
  }

  public MarsGoal(MarsGoal g)
  {
    super((MarsData) g);
    if (g == null)
    {
      role = 0;
      step = 0;
      activity = 0;
      special = 0;
      description= "";
    }
    else
    {
      role = g.role;
      step = g.step;
      activity = g.activity;
      special = g.special;
      description= g.description;
    }
  }
  
  public MarsGoal(String line)
  {
    super(line);
    role = readInteger(line, 0);
    step = readInteger(line, 1);
    activity = readInteger(line, 2);
    special = readInteger(line, 3);
    description = readString(line, 4);
  }

  public String toString()
  {
    String s = new String();
    
    s = getRoleName(role) + ", Step ";
    s = s + new Integer(step).toString() + ", ";
    s = s + description;

    return s;
  }

  public String toFile()
  {
    String s = new String();
    
    s = new Integer(role).toString() + ",";
    s = s + new Integer(step).toString() + ",";
    s = s + new Integer(activity).toString() + ",";
    s = s + new Integer(special).toString() + ",";
    s = s + description + ",";

    return s;
  }
}
