using System;
using System.Collections;
using System. Drawing;
namespace PocketJack
{
///
/// Provides the behaviours required to manage and draw cards
///
public class Card
{
///
/// The number of the card, in the range 1 to 52
///
public byte CardNo;
///
/// Indicates if the card is to be drawn face up.
/// True by default.
///
public bool FaceUp = true;
///
/// The images of the cards. Stored for all the cards.
/// The image with number 0 is the
/// back pattern of the card
///
static private Image [] cardImages = new Bitmap [53];
///
/// The attribute to be used when drawing the card
/// to implement transpancy
///
static public System.Drawing.Imaging.ImageAttributes
cardAttributes;
///
/// Used when loading card images prior to drawing
///
static private System.Reflection.Assembly execAssem;
///
/// Sets up the color and attribute values.
///
static Card ()
{
cardAttributes =
new System.Drawing.Imaging.ImageAttributes ();
cardAttributes.SetColorKey(Color.Green, Color.Green);
execAssem =
System.Reflection.Assembly.GetExecutingAssembly ();
}
///
/// Scores for each of the cards in a suit
///
static private byte [] scores =
new byte [] {11, //ace
2,3,4,5,6,7,8,9,10, //spot cards
10,10,10}; //jack, queen, king
///
/// Picture information for each card in a suit
///
static private bool [] isPicture =
new bool [] {false, //ace
false, false, false, false, false, false,
false, false, false, //spot cards
true, true, true}; //jack, queen, king
///
/// Names of the suits, in the order that of the suits
/// in the number sequence
///
static private string [] suitNames =