package uk.co.patrickhaston.mars;

public class MarsEnable extends MarsData 
{
  // Contains
  private int technology;
  // The technology that must be discovered to allow new constructions
  // to be built and new technologies to be researched.
  private int newConstruction; // the new construction
  private int newTechnology; // the new technology
  private String description;

  public MarsEnable(int id)
  {
    super(id);
    technology = 0;
    newConstruction = 0;
    newTechnology = 0;
    description = "";
  }

  public MarsEnable(MarsEnable e)
  {
    super(e);
    technology = e.technology;
    newConstruction = e.newConstruction;
    newTechnology = e.newTechnology;
    description = e.description;
  }
  
  public MarsEnable(String line)
  {
    super(line);
    technology = readInteger(line, 0);
    newConstruction = readInteger(line, 1);
    newTechnology = readInteger(line, 2);
    description = readString(line,3);
  }

  public String toString()
  {
    return description;
  }

  public String toFile()
  {
    String s = new String();
    
    s = s + new Integer(technology).toString() + ",";
    s = s + new Integer(newConstruction).toString() + ",";
    s = s + new Integer(newTechnology).toString() + ",";
    s = s + description + ",";

    return s;
  }

  public int getTechnology()
  {
    return technology;
  }

  public int getNewConstruction()
  {
    return newConstruction;
  }

  public int getNewTechnology()
  {
    return newTechnology;
  }

  public String getDescription()
  {
    return description;
  }
}

