File indexing completed on 2024-10-06 06:48:46

0001 /***************************************************************************
0002                           dice.cpp  -  description
0003                              -------------------
0004     begin                : sat dec 29 2002
0005     copyright (C) 2002 by Gael de Chalendar (aka Kleag) <kleag@free.fr>
0006  ***************************************************************************/
0007 
0008 /***************************************************************************
0009  *                                                                         *
0010  *   This program is free software; you can redistribute it and/or modify  *
0011  *   it under the terms of the GNU General Public License as published by  *
0012  *   the Free Software Foundation; either either version 2
0013    of the License, or (at your option) any later version.of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  *   You should have received a copy of the GNU General Public License
0017  *   along with this program; if not, write to the Free Software
0018  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0019  *   02110-1301, USA
0020  ***************************************************************************/
0021 
0022 #include "dice.h"
0023 
0024 #include <QRandomGenerator>
0025 
0026 namespace Ksirk
0027 {
0028 
0029 namespace GameLogic
0030 {
0031 
0032 Dice::Dice(){
0033 }
0034 Dice::~Dice(){
0035 }
0036 
0037 unsigned int Dice::roll(unsigned int max)
0038 {
0039   return 1 + QRandomGenerator::global()->bounded(max);;
0040 }
0041 
0042 }
0043 }