| 1 | |
|---|
| 2 | /*************************************************************************** |
|---|
| 3 | * Copyright (C) 2006-2007 by Guy Rutenberg * |
|---|
| 4 | * guyrutenberg@gmail.com * |
|---|
| 5 | * * |
|---|
| 6 | * This program is free software; you can redistribute it and/or modify * |
|---|
| 7 | * it under the terms of the GNU General Public License as published by * |
|---|
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
|---|
| 9 | * (at your option) any later version. * |
|---|
| 10 | * * |
|---|
| 11 | * This program is distributed in the hope that it will be useful, * |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
|---|
| 14 | * GNU General Public License for more details. * |
|---|
| 15 | * * |
|---|
| 16 | * You should have received a copy of the GNU General Public License * |
|---|
| 17 | * along with this program; if not, write to the * |
|---|
| 18 | * Free Software Foundation, Inc., * |
|---|
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | #ifndef SCORE_DICE_H |
|---|
| 22 | #define SCORE_DICE_H |
|---|
| 23 | |
|---|
| 24 | class ScoreDice { |
|---|
| 25 | public: |
|---|
| 26 | ScoreDice(); |
|---|
| 27 | ScoreDice(short int dice[5]); |
|---|
| 28 | void SetDice(const short int dice[5]); |
|---|
| 29 | void SetYahtzeeJoker(bool is_yahtzee_joker); |
|---|
| 30 | short int GetDice(short int number); |
|---|
| 31 | |
|---|
| 32 | short int Aces() const; |
|---|
| 33 | short int Twos() const; |
|---|
| 34 | short int Threes() const; |
|---|
| 35 | short int Fours() const; |
|---|
| 36 | short int Fives() const; |
|---|
| 37 | short int Sixes() const; |
|---|
| 38 | |
|---|
| 39 | short int ThreeOfAKind() const; |
|---|
| 40 | short int FourOfAKind() const; |
|---|
| 41 | short int FullHouse() const; |
|---|
| 42 | short int SmallSequence() const; |
|---|
| 43 | short int LargeSequence() const; |
|---|
| 44 | short int Yahtzee() const; |
|---|
| 45 | short int Chance() const; |
|---|
| 46 | |
|---|
| 47 | bool IsYahtzee() const; |
|---|
| 48 | |
|---|
| 49 | private: |
|---|
| 50 | short int m_dice[5]; |
|---|
| 51 | short int m_dicehash[6]; |
|---|
| 52 | bool m_yahtzee_joker; |
|---|
| 53 | |
|---|
| 54 | }; |
|---|
| 55 | |
|---|
| 56 | #endif //SCORE_DICE_H |
|---|