-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.py
50 lines (35 loc) · 1.06 KB
/
Player.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
#Player
#Authors Mario Carricato & Marco Amato
import socket
class Player:
def __init__(self):
self.name = ""
self.address = ()
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.symbol = ""
def set_connection(self, connection):
self.connection =connection
def set_name(self, name):
self.name = name
def set_address(self, address):
self.address = address
def set_symbol(self, symbol):
self.symbol = symbol
def get_connection(self):
return self.connection
def get_name(self):
return self.name
def get_address(self):
return self.address
def get_symbol(self):
return self.symbol
def get_player_name(self):
return self.name
def init_player(self, name, address, connection):
self.set_name(name)
self.set_address(address)
self.set_connection(connection)
def insert_player_name(self,name):
self.name = name
def close_connection(self):
self.connection.close()