소스 검색

Fixing comments a little.

Sam Jaffe 4 년 전
부모
커밋
afe884f397
2개의 변경된 파일16개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 0
      include/dice-roll/die.h
  2. 9 6
      include/dice-roll/parser.h

+ 7 - 0
include/dice-roll/die.h

@@ -32,6 +32,13 @@ struct mod {
   int value;
 };
 
+/**
+ * In some cases, the roller is not interested in the actual value of the dice
+ * rolled, but only if they pass some metric.
+ * This object allows us to perform that check, and then conveniently obfuscate
+ * the numbers rolled so that the player cannot intuit their odds of success in
+ * the short term.
+ */
 struct difficulty_class {
   enum class test { None, Less, LessOrEqual, Greater, GreaterOrEqual };
   

+ 9 - 6
include/dice-roll/parser.h

@@ -20,17 +20,20 @@ namespace dice {
  *
  * dice-string:
  *   dice-expression
- *   positive-integer { dice-expression }
- *
- * positive-integer: Any integer number >= 0
+ *   positive-integer '{' dice-expression '}'
  *
  * dice-expression:
  *   die-expression
- *   die-expression + dice-expression
- *   die-expression - dice-expression
+ *   die-expression {'+'|'-'} dice-expression-rec
+ *
+ * dice-expression-rec:
+ *   {die-expression|modifier}
+ *   {die-expression|modifier} {'+'|'-'} dice-expression-rec
+ *
+ * modifier:
+ *   positive-integer
  *
  * die-expression:
- *   integer
  *   positive-integer 'd' positive-integer
  *   positive-integer 'D' positive-integer
  */