Skip to content

Commit 12909c5

Browse files
committed
Added documentation for the dice classes
1 parent 7c4d9d6 commit 12909c5

6 files changed

Lines changed: 90 additions & 3 deletions

File tree

dice_notation/dice.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class Dice(object):
6565
which a die may physically have are limited by the rules of geometry,
6666
but there is no reason to take care of that.
6767
"""
68-
__metaclass__ = ABCMeta
6968

7069
def __init__(self, quantity, sides):
7170
super(Dice, self).__init__()
5.24 KB
Loading
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<diagram program="umlet" version="14.2">
3+
<zoom_level>10</zoom_level>
4+
<element>
5+
<id>UMLClass</id>
6+
<coordinates>
7+
<x>310</x>
8+
<y>210</y>
9+
<w>100</w>
10+
<h>70</h>
11+
</coordinates>
12+
<panel_attributes>bg=orange
13+
/Rollable/
14+
--
15+
16+
--
17+
/+roll()/</panel_attributes>
18+
<additional_attributes/>
19+
</element>
20+
<element>
21+
<id>UMLClass</id>
22+
<coordinates>
23+
<x>470</x>
24+
<y>210</y>
25+
<w>100</w>
26+
<h>70</h>
27+
</coordinates>
28+
<panel_attributes>bg=yellow
29+
Dice
30+
--
31+
+quantity: int
32+
+sides: int
33+
--</panel_attributes>
34+
<additional_attributes/>
35+
</element>
36+
<element>
37+
<id>UMLClass</id>
38+
<coordinates>
39+
<x>390</x>
40+
<y>360</y>
41+
<w>100</w>
42+
<h>70</h>
43+
</coordinates>
44+
<panel_attributes>bg=yellow
45+
RollableDice
46+
--
47+
48+
--</panel_attributes>
49+
<additional_attributes/>
50+
</element>
51+
<element>
52+
<id>Relation</id>
53+
<coordinates>
54+
<x>350</x>
55+
<y>270</y>
56+
<w>110</w>
57+
<h>110</h>
58+
</coordinates>
59+
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
60+
<additional_attributes>10.0;10.0;10.0;50.0;90.0;50.0;90.0;90.0</additional_attributes>
61+
</element>
62+
<element>
63+
<id>Relation</id>
64+
<coordinates>
65+
<x>430</x>
66+
<y>270</y>
67+
<w>110</w>
68+
<h>70</h>
69+
</coordinates>
70+
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
71+
<additional_attributes>90.0;10.0;90.0;50.0;10.0;50.0</additional_attributes>
72+
</element>
73+
</diagram>

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
'general_info_links': [('Acquire', './acquire.html'),
116116
('Usage', './usage.html')],
117117
'navbar_links': [('Documentation', [('Acquire', './acquire.html'),
118-
('Usage', './usage.html')]),
118+
('Usage', './usage.html'),
119+
('Dice model', './docs/dice.html')]),
119120
('Info and Reports', [('Reports', './reports.html'),
120121
('Code docs', './code/index.html')])],
121122
}

docs/source/docs/dice.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
==========
2+
Dice model
3+
==========
4+
5+
.. image:: ../_static/diagram/dice_class_diagram.png
6+
:alt: Dice class diagram
7+
8+
While the Dice class represents a dice group, it is the RollableDice the actual
9+
class which will be used by the parser, as it allows generating random values
10+
through the use of the roll() method.
11+
12+
The Rollable abstract class is actually used to extend to add compatibility
13+
between the dice and other classes, and will be used by the parser nodes to
14+
allow rolling any parsed dice notation expression.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Features
2323
acquire
2424
usage
2525
reports
26-
code/dice
2726
code/index
27+
docs/dice

0 commit comments

Comments
 (0)