
// Copyright (c) 2004 
package uk.co.patrickhaston.mars;


import java.awt.Graphics;

/**
 * A Class class.
 * <P>
 * @author Patrick Haston
 */
public class MarsConstructionTypes extends MarsTypes 
{

  /**
   * Constructor
   */
  public MarsConstructionTypes(MarsModel model) 
  {
    theModel = model;
  }

  public void readData(String line)
  {
    int idx = readIndex(line);
    if (idx>0)
    {
      MarsConstructionType t = new MarsConstructionType(line, theModel);
      //Name,Components,ResourcesMaxStore,ResourceUse,MaxOccupants,Workers,Duplicates,Movement,Description
      //t.description = readString(line, 8);

      this.setElementAt(t, idx);
    }
  }
  
  public void paintAt(int constructionTypeId, Graphics g, int x, int y, int orientation, int cStatus, MarsView view)
  {
    if(constructionTypeId < 1) return;
    if(size() < 2) return;
    if(constructionTypeId >= size()) return;
    ((MarsConstructionType) elementAt(constructionTypeId)).paintAt(g, x, y, orientation, cStatus, view);
  }
  
}

 
