-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Thepunisher79/dev
Dev
- Loading branch information
Showing
4 changed files
with
83 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Player: | ||
"""A player in mafia game""" | ||
def __init__(self, ip, username, role, image_name): | ||
self.ip = ip | ||
self.username = username | ||
self.state = "alive" | ||
self.role = role | ||
self.image_name = image_name | ||
self.comment = False | ||
|
||
def get_state(self): | ||
return self.state | ||
|
||
def get_ip(self): | ||
return self.ip | ||
|
||
def get_username(self): | ||
return self.username | ||
|
||
def get_role(self): | ||
return self.role | ||
|
||
def get_image_name(self): | ||
return self.image_name | ||
|
||
def get_comment(self): | ||
return self.comment | ||
|
||
|
||
def set_state(self, state): | ||
if state in ["alive", "dead", "banned"]: | ||
self.state = state | ||
|
||
def set_comment(self, comment): | ||
self.comment = comment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters