
// Copyright (c) 2004
package uk.co.patrickhaston.mars;


/**
 * A Class class.
 * <P>
 * @author Patrick Haston
 */
public class MarsGroup extends MarsData {

  public String name;
  public long populationSize;
  public int totalResourceId;
  // index in Resources array pointing to the resources owned by
  // this group.
  public int totalOutputId;
  // index in Resources array pointing to the annual output of the group

  /**
   * Constructor
   */
  public MarsGroup(int id) 
  {
    super(id);
    name = "";
    populationSize = 0;
    totalResourceId = -1;
    totalOutputId = -1;
  }
  
  public MarsGroup(String line)
  {
    super(line);
    name = readString(line, 0);
    populationSize = readLong(line, 1);
    totalResourceId = readInteger(line, 2);
    totalOutputId = readInteger(line, 3);
  }

  public String toString()
  {
    String s = new String();
    
    s = name + ",";
    s = s + new Long(populationSize).toString() + ",";
    s = s + new Integer(totalResourceId).toString() + ",";
    s = s + new Integer(totalOutputId).toString() + ",";

    return s;
  }
}

 
