Compare commits
2 Commits
7377f74d92
...
521e767741
Author | SHA1 | Date | |
---|---|---|---|
|
521e767741 | ||
|
db23a056ec |
@ -18,7 +18,7 @@ class GameMap:
|
|||||||
|
|
||||||
|
|
||||||
def add_player_mark(self, x, y, player):
|
def add_player_mark(self, x, y, player):
|
||||||
if x <= self.max_size_x and y <= self.max_size_y:
|
if (x <= self.max_size_x and y <= self.max_size_y) and (x >= 0 and y >= 0):
|
||||||
self.data[(x,y)] = player
|
self.data[(x,y)] = player
|
||||||
player.record_mark(x, y)
|
player.record_mark(x, y)
|
||||||
else:
|
else:
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
class Player():
|
class Player():
|
||||||
|
|
||||||
def __init__(self, name, color):
|
def __init__(self, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.color = color
|
|
||||||
self.markList = []
|
self.markList = []
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Player " + self.name + ': ' + "Color - " + self.color + "\n " + str(self.markList)
|
return "Player " + self.name + ': ' + "\n " + str(self.markList)
|
||||||
|
|
||||||
|
|
||||||
def record_mark(self, x, y):
|
def record_mark(self, x, y):
|
||||||
|
Loading…
Reference in New Issue
Block a user