qnetdice
annotate src/roll.h @ 4:7d28bef3fbca
ops, forgot to add +1 to random numbers in roll.cc to make them 1-based
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 23 Dec 2013 17:40:34 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@1 | 1 #ifndef ROLL_H_ |
nuclear@1 | 2 #define ROLL_H_ |
nuclear@1 | 3 |
nuclear@1 | 4 #include <string> |
nuclear@1 | 5 |
nuclear@1 | 6 class Roll { |
nuclear@1 | 7 private: |
nuclear@1 | 8 int sides; |
nuclear@1 | 9 int value; |
nuclear@1 | 10 std::string name; |
nuclear@1 | 11 |
nuclear@1 | 12 public: |
nuclear@1 | 13 explicit Roll(int sides = 20); |
nuclear@1 | 14 |
nuclear@1 | 15 void set_name(const char *name); |
nuclear@1 | 16 void set_sides(int sides); |
nuclear@1 | 17 void set_value(int value); |
nuclear@1 | 18 |
nuclear@1 | 19 const char *get_name() const; |
nuclear@1 | 20 int get_sides() const; |
nuclear@1 | 21 int get_value() const; |
nuclear@1 | 22 |
nuclear@1 | 23 int roll(); |
nuclear@1 | 24 }; |
nuclear@1 | 25 |
nuclear@1 | 26 #endif // ROLL_H_ |