-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpiece.py
executable file
·65 lines (56 loc) · 1.57 KB
/
piece.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## DeepYellowJ - Version 0.1 (c) 2016 Ahmad Nazeri
# Piece - piece.py
#
# This file is the object class for a piece.
# The piece keeps track of name, color,
# point value, and if it has been moved.
class Piece:
# Constructor for Piece.
#
# Parameters:
# name - String
# color - String
# pointValue - int
def __init__(self, name, color, pointValue):
self._name = name
self._color = color
self._pointValue = pointValue
self._moved = False
# Change once the piece has moved
def changedMoved(self):
self._moved = True
# Changes the name of piece
#
# Parameter:
# name - String
def changeName(self, name):
self._name = name
# Changes the point value of the piece
#
# Parameters:
# pointValue - int
def changePointValue(self, pointValue):
self._pointValue = pointValue
## USED TO RETURN PRIVATE VARIABLES
# Returns the name of the piece
#
# Returns:
# self._name - String
def getName(self):
return self._name
# Returns the color of the piece:
#
# Returns:
# self._color - String
def getColor(self):
return self._color
# Returns the point value of piece
#
# Returns:
# self._pointValue - int
def getPointValue(self):
return self._pointValue
# Returns whether piece has moved or not
# Returns: (boolean)
def getPieceMoved(self):
return self._moved