/*
 * Created on Dec 9, 2004
 *
 * Utilizes Java Power Tools
 * http://www.ccs.neu.edu/jpt/
 */

/**
 * Authored by Brandon Schory
 *
 * With help, inspiration, and code from Richard Rasala, Mike Battista, Ken Eimer, and Matt DeGennaro
 * 
 */

import edu.neu.ccs.gui.*;

public class Person {
    
    //A person can be either a dealer or a player;
    	
	/** Updates the total value of the person's Cards */
	public static int Total(int value, int total){
		total += value;
		return total;
	}

	/** Handles all aspects of a person's card images, including:
	 * - Places Card Images into the JPTFrame
	 * - Places the first four cards in the appropriate spot
	 * - With 5 or more cards, shifts each card one spot to the right and replaces first image with card back
	 */
	public static void ReturnCardImage(Card c, ImageTile[] cards, int NumberOfCards){
		if(NumberOfCards < 5){
			cards[NumberOfCards - 1].setPaintable(new ImagePaintable(c.image));
		}
		else{
			cards[0].setPaintable(new ImagePaintable(Deck.Images[52]));
			cards[1] = cards[2];
			cards[2] = cards[3];
			cards[3].setPaintable(new ImagePaintable(c.image));	
		}
	}
}
