//
// Casino.idl - This is the full set of interfaces for the Virtual Casino
// Client/Server Application.
// Authors - Team5
// Date - Jan 31, 2003
//
// NB: compile me with idlj -fall -pkgPrefix Casino edu.cmu.mse17654 Casino.idl
//
/** The Casino Module holds all the interfaces for the Virtual Casino Project
*/
module Casino {
/**
* An exception meant to be raised when a player tries to buy chips
* without enough fund on his/her credit card
* @version 0.1
* @author Team5
*/
exception InsufficientMoney {
/** The amount of money needed for the transaction*/
short requested;
/** The players credit card balance */
short balance;
};
/**
* An exception meant to be raised when a player tries to buy bet
* more chips than he/she has.
* @version 0.1
* @author Team5
*/
exception InsufficientChips {
/** The amount of chips needed for the transaction*/
short requested;
/** The players chip balance */
short balance;
};
/** A non-existant or impossible SessionID has been passed to a method*/
exception InvalidSessionID {
/**The invalid id used */
short idUsed;
};
/** A credit card information is poorly formed or non-existant*/
exception InvalidCredit {
/** The Credit Card information passed to the method*/
short CreditCardInfoUsed;
};
/** The system is not able to provide a table for the player
* to play at.
*/
exception no_more_tables {};
/**
* Callback interface for server(s) to "pull" from clients.
*
- Category: Baseline (fulfills requirement #8)
* - Behavior: This interface provides the callback methods of a player.
* The dealer leads the Blackjack game, and the players react to the
* dealer's commands and requests. During the game client
* and server roles are swapped.
* - Inherits From:
* - Clients: Dealer
* @version 0.1
* @author team5
*/
interface Player {
/**
* A dealer request for a player to bet on his/her cards.
* - Category: Baseline
* - Behavior: The player is prompted for his bet for the next game.
* - Clients: Dealer
* @parm amount The client's bet in chips.
* @returns void
* @raises InsufficientChips If the player has no chips to bet
*/
void placeBet(out short amount)
raises(InsufficientChips);
/**
* A dealer sends a card to a player
* - Category: Baseline
* - Behavior: This method passes a card to the player.
* - Clients: Dealer
* @parms cardID The ID of the new card.
* @returns void
*/
void acceptCard(in octet cardID);
/**
* The dealer is giving a player another player's card to view.
* - Category: Baseline
* - Behavior: A player client uses this method to register for a session
* at the casino server.
* - Clients: Dealer
* @parm playerID The number (1..4) of the other player at the
* table who gets this card.
* @parm cardID The ID of the new card.
* @returns void
*/
void acceptOthersCard(in short playerID,
in octet cardID);
/**
* The dealer is telling the player that the game is starting
* - Category: Baseline
* - Behavior: Start a new game at the current table.
* - Clients: Dealer
* @parm numberOfPlayers The number of players at the table.
* @returns void
*/
void startGame(in octet numberOfPlayers);
/**
* The dealer is asking the player to stay or hit.
* - Category: Baseline
* - Behavior: Ask the player what he/she wants to do next.
* Either get a another card (HIT) or not (STAY).
* - Clients: Dealer
* @parm choice
* @returns void
*/
void playerOption(out octet choice);
/**
* The dealer is telling the player that the game if over.
* - Category: Baseline
* - Behavior: Let the player know that the game is over, if he has won,
* and his new chip balance.
* - Clients: Dealer
* @parm won True iff the player has won.
* @parm newBalance The new chip balance of the player.
* @returns void
*/
void gameOver(in boolean won,
in short newBalance);
/**
* The dealer is kicking the player off the game for misbehavior
* - Category: Realtime
* - Behavior: If a player does not place a bet or choose an option
* within the allotted amout of time, the Dealer kicks
* him out.
* - Clients: Dealer
* @returns void
*/
void kickOut();
};
/**
* An exception raised to indicate that a non-existant player has been
* passed to a method.
*/
exception InvalidPlayer {
/** The player passed to the method.*/
Player playerUsed;
};
/**
* The interface used to simulate monetary transactions
*- Category: Baseline (fulfills baseline requirements #1 & #5)
*- Behavior: This interface supports methods to simulate the
* buying and selling of gambling chips.
*- Clients: Player
* @author team5
* @version 0.1
*/
interface Bank {
/**
* The player is purchasing chips from the bank.
* - Category: Baseline.
* - Behavior: The player give his/her (simulated) credit card information
* and quantity of chips requested and is given that number of
* chips. If there is not enough money in the credit account
* an exception is thrown.
* - Clients: Player
* @parm quantity The number of chips requested.
* @parm CreditCardInfo The simulated credit card.
* @returns void
* @raises InsufficientMoney
* @raises InvalidCredit
*/
void buyChips(in Player player,
in short quantity,
in short CreditCardInfo)
raises(InsufficientMoney,
InvalidCredit);
/**
* The player is selling chips back to the bank.
* - Category: Baseline.
* - Behavior: The player sells all or some of his chips back to the
* Bank.
* - Clients: Player
* @parm quantity The number of chips to be sold.
* @returns void
* @raises InsufficientChips
*/
void sellChips(in Player player,
in short quantity)
raises(InvalidSessionID,
InsufficientChips);
/**
* The player requests the number of chips he/she owns
* - Category: Baseline.
* - Behavior: The player requests the balance of chips from the bank.
* - Clients: Player
* @parm sessionID The current gaming session.
* @parm quantity The number of chips to be sold.
* @returns void
* @raises InsufficientChips
*/
short getChipBalance(in Player player)
raises(InvalidPlayer,
InsufficientChips,
InvalidSessionID);
};
/**
* The set of gaming tables
* - Category: Baseline (fulfills baseline requirment #4)
* - Behavior: This interface supports methods to allow a player
* to join a game at a virtual table.
* - Clients: Player
* @author team5
* @version 0.1
*/
interface Tables {
/**
* Player asks to join any table.
* - Category: Baseline
* - Behavior: Enables a player to join a table.
* - Clients: Players
* @parm player The player object reference.
* @parm sessionID The table session that the player joined.
* @returns void
* @raises InvalidPlayer The player object is invalid.
*/
void joinTable(in Player player,
out short sessionID)
raises(InvalidPlayer);
/**
* Player elects to leave a game.
* - Category: Baseline
* - Behavior: Enables a player to leave a table.
* - Clients: Players
* @parm sessionID The table session for the player.
* @returns void
* @raises InvalidSessionID The passed sessionID is invalid.
*/
void leaveTable(in short sessionID)
raises(InvalidSessionID);
};
/**
* The "floor" of the casino, containing many tables
* - Category: Baseline (fulfills requirement #1)
* - Behavior: This interface is the main entrance into the casino.
* - Inherits From:
* - Exceptions: CORBA System exceptions
* - Clients: Player
* @author team5
* @version 0.1
*/
interface Floor {
/**
* The new or returning player registers with the system to start
* - Category: Baseline
* - Behavior: A player client uses this method to register for a session
* at the casino server.
* - Clients: Player
* @parm player The client's Player interface.
* @parm bank The casino's Bank to buy chips
* @parm tables The Blackjack table manager.
* @returns void
* @raises InvalidPlayer
*/
void register(in Player player,
out Bank bank,
out Tables tables)
raises(InvalidPlayer);
};
};