summaryrefslogtreecommitdiff
path: root/doxygen/man/man3/pirate7_Pirate.3
blob: 1c075617250a39905a53bf5884e0ea85f942e041 (plain)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
.TH "pirate7::Pirate" 3 "Fri Sep 9 2011" "Cmd2" \" -*- nroff -*-
.ad l
.nh
.SH NAME
pirate7::Pirate \- 
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBcmd2::Cmd\fP'\&.
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "def \fBdefault\fP"
.br
.ti -1c
.RI "def \fBdo_drink\fP"
.br
.ti -1c
.RI "def \fBdo_loot\fP"
.br
.ti -1c
.RI "def \fBdo_quit\fP"
.br
.ti -1c
.RI "def \fBdo_sing\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 "\fBdefault_to_shell\fP = True"
.br
.ti -1c
.RI "int \fBgold\fP = 3"
.br
.ti -1c
.RI "list \fBmultilineCommands\fP = ['sing']"
.br
.ti -1c
.RI "string \fBprompt\fP = 'arrr> '"
.br
.ti -1c
.RI "string \fBsettable\fP = '\fBsongcolor\fP Color to ``sing`` in (red/blue/green/cyan/magenta, bold, underline)'"
.br
.ti -1c
.RI "string \fBsongcolor\fP = 'blue'"
.br
.ti -1c
.RI "list \fBterminators\fP = \fBCmd\&.terminators\fP+['\&.\&.\&.']"
.br
.in -1c
.SH "Detailed Description"
.PP 
Definition at line 4 of file pirate7\&.py'\&.
.SH "Member Function Documentation"
.PP 
.SS "def pirate7::Pirate::default (self, line)"
.PP
Definition at line 7 of file pirate7\&.py'\&.
.PP
Referenced by cmd2::Cmd::_default()\&.
.PP
.nf
7 
8     def default(self, line):
        print('What mean ye by '{0}'?'\&.format(line))
.fi
.SS "def pirate7::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 12 of file pirate7\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, pirate6::Pirate::gold, pirate5::Pirate::gold, pirate4::Pirate::gold, and pirate3::Pirate::gold\&.
.PP
.nf
12 
13     def do_drink(self, arg):
14         '''Drown your sorrrows in rrrum\&.
15         
16         drink [n] - drink [n] barrel[s] o' rum\&.'''          
17         try:
18             self\&.gold -= int(arg)
19         except:
20             if arg:
21                 print('''What's '{0}'?  I'll take rrrum\&.'''\&.format(arg))
            self\&.gold -= 1            
.fi
.SS "def pirate7::Pirate::do_loot (self, arg)"
.PP
Definition at line 9 of file pirate7\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, pirate6::Pirate::gold, pirate5::Pirate::gold, pirate4::Pirate::gold, and pirate3::Pirate::gold\&.
.PP
.nf
9 
10     def do_loot(self, arg):
11         'Seize booty from a passing ship\&.'
        self\&.gold += 1
.fi
.SS "def pirate7::Pirate::do_quit (self, arg)"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 33 of file pirate7\&.py'\&.
.PP
.nf
33 
34     def do_quit(self, arg):
35         print('Quiterrr!')
        return True    
.fi
.SS "def pirate7::Pirate::do_sing (self, arg)"
.PP
Definition at line 42 of file pirate7\&.py'\&.
.PP
References cmd2::Cmd::colorize(), and songcolor\&.
.PP
.nf
42 
43     def do_sing(self, arg):
44         print(self\&.colorize(arg, self\&.songcolor))

.fi
.SS "def pirate7::Pirate::postcmd (self, stop, line)"
.PP
Definition at line 25 of file pirate7\&.py'\&.
.PP
References pirate2::Pirate::gold, pirate3::Pirate::gold, pirate5::Pirate::gold, pirate6::Pirate::gold, pirate4::Pirate::gold, gold, pirate3::Pirate::initial_gold, pirate5::Pirate::initial_gold, pirate4::Pirate::initial_gold, initial_gold, and pirate6::Pirate::initial_gold\&.
.PP
Referenced by cmd2::Cmd::onecmd_plus_hooks()\&.
.PP
.nf
25 
26     def postcmd(self, stop, line):   
27         if self\&.gold != self\&.initial_gold:
28             print('Now we gots {0} doubloons'
29                   \&.format(self\&.gold))
30         if self\&.gold < 0:
31             print('Off to debtorrr's prison\&.')
32             stop = True
        return stop
.fi
.SS "def pirate7::Pirate::precmd (self, line)"
.PP
Definition at line 22 of file pirate7\&.py'\&.
.PP
References pirate2::Pirate::gold, gold, pirate4::Pirate::gold, pirate5::Pirate::gold, pirate6::Pirate::gold, pirate3::Pirate::gold, pirate3::Pirate::initial_gold, pirate4::Pirate::initial_gold, pirate5::Pirate::initial_gold, initial_gold, and pirate6::Pirate::initial_gold\&.
.PP
Referenced by cmd2::Cmd::onecmd_plus_hooks()\&.
.PP
.nf
22 
23     def precmd(self, line):
24         self\&.initial_gold = self\&.gold
        return line
.fi
.SH "Member Data Documentation"
.PP 
.SS "\fBpirate7::Pirate::default_to_shell\fP = True\fC [static]\fP"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 36 of file pirate7\&.py'\&.
.SS "int \fBpirate7::Pirate::gold\fP = 3\fC [static]\fP"
.PP
Definition at line 5 of file pirate7\&.py'\&.
.PP
Referenced by do_drink(), pirate8::Pirate::do_drink(), do_loot(), pirate8::Pirate::do_loot(), postcmd(), pirate8::Pirate::postcmd(), precmd(), and pirate8::Pirate::precmd()\&.
.SS "\fBpirate7::Pirate::initial_gold\fP"
.PP
Definition at line 22 of file pirate7\&.py'\&.
.PP
Referenced by postcmd(), pirate8::Pirate::postcmd(), pirate8::Pirate::precmd(), and precmd()\&.
.SS "list \fBpirate7::Pirate::multilineCommands\fP = ['sing']\fC [static]\fP"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 37 of file pirate7\&.py'\&.
.SS "string \fBpirate7::Pirate::prompt\fP = 'arrr> '\fC [static]\fP"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 6 of file pirate7\&.py'\&.
.SS "string \fBpirate7::Pirate::settable\fP = '\fBsongcolor\fP Color to ``sing`` in (red/blue/green/cyan/magenta, bold, underline)'\fC [static]\fP"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 40 of file pirate7\&.py'\&.
.SS "string \fBpirate7::Pirate::songcolor\fP = 'blue'\fC [static]\fP"
.PP
Definition at line 39 of file pirate7\&.py'\&.
.PP
Referenced by do_sing(), and pirate8::Pirate::do_sing()\&.
.SS "list \fBpirate7::Pirate::terminators\fP = \fBCmd\&.terminators\fP+['\&.\&.\&.']\fC [static]\fP"
.PP
Reimplemented from \fBcmd2::Cmd\fP'\&.
.PP
Definition at line 38 of file pirate7\&.py'\&.

.SH "Author"
.PP 
Generated automatically by Doxygen for Cmd2 from the source code'\&.