-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rabbit.py
51 lines (40 loc) · 1.2 KB
/
Rabbit.py
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
from Creature import Creature
class Rabbit(Creature):
def __init__(self, x, y):
"""
Initializes a Rabbit object.
:param x: The x-coordinate of the Rabbit's position.
:type x: int
:param y: The y-coordinate of the Rabbit's position.
:type y: int
"""
super().__init__(x, y, "R") # "R" is the symbol for the Rabbit
# If there are additional attributes or methods specific to the Rabbit, they can be added here
def get_x(self):
"""
Retrieves the x-coordinate of the Rabbit.
:return: The x-coordinate.
:rtype: int
"""
return self._x
def set_x(self, value):
"""
Sets the x-coordinate of the Rabbit.
:param value: The new x-coordinate value.
:type value: int
"""
self._x = value
def get_y(self):
"""
Retrieves the y-coordinate of the Rabbit.
:return: The y-coordinate.
:rtype: int
"""
return self._y
def set_y(self, value):
"""
Sets the y-coordinate of the Rabbit.
:param value: The new y-coordinate value.
:type value: int
"""
self._y = value