Unit Card

Classes

TCard -

Functions

Register -

Types

TCardSuit
TCardValue
TDecks
TShortSuit

Constants

Variables


Functions


procedure Register;


Types


TCardSuit = (Spades,Diamonds,Clubs,Hearts);

TCardValue = 1..13
TCard component for Delphi 32 - Freeware. Version 1.1 (26-9-97) Copyright 1997 by Giulio Ferrari This is Freeware. Feel free to improve the code and to use the component as you like. Please share your Delphi components and support the freeware concept. I'm not responsible for any damage on your computer. PROPERTIES property Value; The value of the card, between 1 and 13 ( 11,12,13 are court cards; 1 is the ace). property Suit; The suit of the card (Hearts,Clubs,Diamonds,Spades). property ShowDeck; If True shows the back of the card. property DeckType; Select the type of deck that is shown if ShowDeck is True. METHODS procedure SetCard(CValue: Integer; CSuit: TShortSuit); Quickly set card's Value and Suit. e.g. Card1.SetCard(1,H); // set card to Ace of Hearts procedure Turn; Turn the card and show the deck, or viceversa. procedure RandomCard; Randomly choose a card. function DifferentFrom(FromCard: TCard): Boolean; Returns True if the card is different in Value or Suit from the specified one.
TDecks = (Standard1, Standard2, Fishes1, Fishes2,
           Beach, Leaves1, Leaves2, Robot,
           Roses, Shell, Castle, Hand);

TShortSuit = (S,D,C,H);

Constants


Variables