1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
.TH "pirate4::Pirate" 3 "Fri Sep 9 2011" "Cmd2" \" -*- nroff -*-
.ad l
.nh
.SH NAME
pirate4::Pirate \-
.SH SYNOPSIS
.br
.PP
.PP
Inherits Cmd'\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "def \fBdo_drink\fP"
.br
.ti -1c
.RI "def \fBdo_loot\fP"
.br
.ti -1c
.RI "def \fBpostcmd\fP"
.br
.ti -1c
.RI "def \fBprecmd\fP"
.br
.in -1c
.SS "Public Attributes"
.in +1c
.ti -1c
.RI "\fBinitial_gold\fP"
.br
.in -1c
.SS "Static Public Attributes"
.in +1c
.ti -1c
.RI "int \fBgold\fP = 3"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line 4 of file pirate4\&.py'\&.
.SH "Member Function Documentation"
.PP
.SS "def pirate4::Pirate::do_drink (self, arg)".PP
.nf
Drown your sorrrows in rrrum.
drink [n] - drink [n] barrel[s] o' rum..fi
.PP
.PP
Definition at line 9 of file pirate4\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, and pirate3::Pirate::gold\&.
.PP
.nf
9
10 def do_drink(self, arg):
11 '''Drown your sorrrows in rrrum\&.
12
13 drink [n] - drink [n] barrel[s] o' rum\&.'''
14 try:
15 self\&.gold -= int(arg)
16 except:
17 if arg:
18 print('''What's '{0}'? I'll take rrrum\&.'''\&.format(arg))
self\&.gold -= 1
.fi
.SS "def pirate4::Pirate::do_loot (self, arg)"
.PP
Definition at line 6 of file pirate4\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, and pirate3::Pirate::gold\&.
.PP
.nf
6
7 def do_loot(self, arg):
8 'Seize booty from a passing ship\&.'
self\&.gold += 1
.fi
.SS "def pirate4::Pirate::postcmd (self, stop, line)"
.PP
Definition at line 22 of file pirate4\&.py'\&.
.PP
References pirate2::Pirate::gold, pirate3::Pirate::gold, gold, pirate3::Pirate::initial_gold, and initial_gold\&.
.PP
Referenced by cmd2::Cmd::onecmd_plus_hooks()\&.
.PP
.nf
22
23 def postcmd(self, stop, line):
24 if self\&.gold != self\&.initial_gold:
25 print('Now we gots {0} doubloons'\&.format(self\&.gold))
.fi
.SS "def pirate4::Pirate::precmd (self, line)"
.PP
Definition at line 19 of file pirate4\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, pirate3::Pirate::gold, pirate3::Pirate::initial_gold, and initial_gold\&.
.PP
Referenced by cmd2::Cmd::onecmd_plus_hooks()\&.
.PP
.nf
19
20 def precmd(self, line):
21 self\&.initial_gold = self\&.gold
return line
.fi
.SH "Member Data Documentation"
.PP
.SS "int \fBpirate4::Pirate::gold\fP = 3\fC [static]\fP"
.PP
Definition at line 5 of file pirate4\&.py'\&.
.PP
Referenced by do_drink(), pirate5::Pirate::do_drink(), pirate8::Pirate::do_drink(), pirate7::Pirate::do_drink(), pirate6::Pirate::do_drink(), do_loot(), pirate5::Pirate::do_loot(), pirate8::Pirate::do_loot(), pirate7::Pirate::do_loot(), pirate6::Pirate::do_loot(), postcmd(), pirate5::Pirate::postcmd(), pirate7::Pirate::postcmd(), pirate8::Pirate::postcmd(), pirate6::Pirate::postcmd(), pirate5::Pirate::precmd(), precmd(), pirate7::Pirate::precmd(), pirate8::Pirate::precmd(), and pirate6::Pirate::precmd()\&.
.SS "\fBpirate4::Pirate::initial_gold\fP"
.PP
Definition at line 19 of file pirate4\&.py'\&.
.PP
Referenced by postcmd(), pirate5::Pirate::postcmd(), pirate7::Pirate::postcmd(), pirate8::Pirate::postcmd(), pirate6::Pirate::postcmd(), precmd(), pirate5::Pirate::precmd(), pirate7::Pirate::precmd(), pirate8::Pirate::precmd(), and pirate6::Pirate::precmd()\&.
.SH "Author"
.PP
Generated automatically by Doxygen for Cmd2 from the source code'\&.
|