package uk.co.patrickhaston.mars;
import uk.co.patrickhaston.pdhsprites.PdhBitmapSprite;
import java.awt.Graphics;
import java.awt.Image;

public class MarsFaceImage extends PdhBitmapSprite 
{
  public MarsFaceImage(Image i, MarsFrame f)
  {
    super(0,0,i,f);
  }

  public void paintAt(Graphics g, int x, int y, int mood)
  {
    int sx = 0; // the source x co-ord of the image to be used
    // this changes depending on the person's mood
    int sy = 0; // the source y co-ord of the image to be used
    // this changes depending on the person's age
    // for future versions

    switch(mood)
    {
      case 1: // Delighted
        sx = 0;
        break;
      case 2: // Happy
        sx = 64;
        break;
      case 3: // Content
        sx = 128;
        break;
      case 4: // Ok
        sx = 192;
        break;
      case 5: // Annoyed
        sx = 256;
        break;
      case 6: // Angry
        sx = 320;
        break;
      case 7: // Furious
        sx = 384;
        break;
    }
    
    g.drawImage(image, x, y, x+64, y+96, sx, sy, sx+64, sy+96, component);
  }
}
