37 lines
925 B
Python
37 lines
925 B
Python
import mech
|
|
from collections import defaultdict
|
|
import clean_dict as c
|
|
|
|
|
|
def add_player(lobby_dict):
|
|
# Set the name
|
|
temp = input("Input your name: ")
|
|
# and immediately add it and a first mech into the lobby
|
|
test1 = mech.Mech(quiet=False,debug=True)
|
|
lobby_dict[temp] = test1
|
|
# cleans None from lobby
|
|
lobby_dict = c.clean(lobby_dict)
|
|
return lobby_dict
|
|
|
|
|
|
def add_mech(lobby_dict):
|
|
# takes the lobby the player is in
|
|
player = input("Input your player ID: ")
|
|
# will need to authenticate player input (this would be serverside IRL)
|
|
temp = [lobby_dict[player]]
|
|
# temporary copy of current player's lobby info'
|
|
temp.append(mech.Mech(quiet=False,debug=True))
|
|
# adds new mech onto list
|
|
return temp
|
|
|
|
lobby_dict = defaultdict(list)
|
|
|
|
test2 = mech.Mech(quiet=True,debug=True)
|
|
|
|
add_player(lobby_dict)
|
|
|
|
for player in lobby_dict.items():
|
|
print('Player: ',player)
|
|
|
|
lobby_dict[player] = add_mech(lobby_dict)
|