// // 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. * * @version 0.1 * @author team5 */ interface Player { /** * A dealer request for a player to bet on his/her cards. * * @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 * * @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. * * @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 * * @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. * * @parm choice * @returns void */ void playerOption(out octet choice); /** * The dealer is telling the player that the game if over. * * @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 * * @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 * * @author team5 * @version 0.1 */ interface Bank { /** * The player is purchasing chips from the bank. * * @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. * * @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 * * @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 * * @author team5 * @version 0.1 */ interface Tables { /** * Player asks to join any table. * * @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. * * @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 * * @author team5 * @version 0.1 */ interface Floor { /** * The new or returning player registers with the system to start * * @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); }; };