main
Defines the main Gandalf class.
Gandalf
A Gandalf class.
Attributes:
Name | Type | Description |
---|---|---|
colour |
str
|
The colour of Gandalf's robes. Defaults to 'grey'. |
Source code in src\gandalf\main.py
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 |
|
mount
property
writable
Gandalf's mount.
weapon
property
writable
The weapon property.
__init__(weapon='Staff')
Initialises Gandalf.
Attributes:
Name | Type | Description |
---|---|---|
weapon |
The weapon that Gandalf wields, defaults to 'Staff'. |
|
mount |
Gandalf's current steed, defaults to None. |
Source code in src\gandalf\main.py
19 20 21 22 23 24 25 26 27 |
|
deny(verb)
Shout a denial of a doing word.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verb |
str
|
An action word to deny someone of. |
required |
Source code in src\gandalf\main.py
58 59 60 61 62 63 64 65 66 |
|
set_colour(colour)
classmethod
Set Gandalf's colour.
Source code in src\gandalf\main.py
29 30 31 32 33 34 |
|
travel()
Ride mount to destination.
Source code in src\gandalf\main.py
68 69 70 71 72 |
|
ImproperGandalfColourError
Bases: Exception
Raise when user tries to set Gandalf to the wrong colour.
Source code in src\gandalf\main.py
83 84 |
|
NeedStaffToDenyError
Bases: Exception
Raise when Gandalf tries to deny without his staff.
Source code in src\gandalf\main.py
79 80 |
|
NoMountSetError
Bases: Exception
Raise when no mount is set for Gandalf..
Source code in src\gandalf\main.py
75 76 |
|
WrongWeaponError
Bases: Exception
Raise when user tries to set a wrong weapon for Gandalf.
Source code in src\gandalf\main.py
87 88 89 90 91 |
|