Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pythonium/bots/pacific_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ class Player(StandardPlayer):
Same as :class:`standard_player.Player` but always build carriers
"""

name = "Nofight Ink."
class_fantasy_name = "Nofight Ink."
tenacity = 0
2 changes: 1 addition & 1 deletion pythonium/bots/random_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Player(AbstractPlayer):
Move the available ships randomly
"""

name = "Walkers"
class_fantasy_name = "Walkers"

def next_turn(self, galaxy, context):

Expand Down
2 changes: 1 addition & 1 deletion pythonium/bots/standard_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Player(AbstractPlayer):

name = "Solar Fed."
class_fantasy_name = "Solar Fed."
colonization_transfer = Transfer(clans=50, megacredits=100)
colonization_carrier_autonomy = 5
colonization_refill_transfer = (
Expand Down
2 changes: 0 additions & 2 deletions pythonium/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def __init__(
:param game_mode: Class that define some game rules
:type game_mode: :class:GameMode
"""
if len(players) != len({p.name for p in players}):
raise ValueError("Player names must be unique")

self.game_mode = game_mode
self.players = players
Expand Down
6 changes: 5 additions & 1 deletion pythonium/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import uuid
import webbrowser
from datetime import date
from datetime import datetime as dt
from pathlib import Path

Expand Down Expand Up @@ -68,8 +69,11 @@ def run(
_players = []
for player_module in players:
player = importlib.import_module(player_module)
_player = player.Player()
fantasy_name = player.Player.class_fantasy_name
_player_name = f"{random_name(len(fantasy_name))} [{fantasy_name}]"
_player = player.Player(_player_name)
_players.append(_player)
# breakpoint()

if stream_state:
output_handler = StreamOutputHanlder()
Expand Down
3 changes: 2 additions & 1 deletion pythonium/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
@attr.s
class AbstractPlayer:

name: str = attr.ib(init=False)
name: str = attr.ib(init=True)

"""
Player's name. Please make it short (less than 12 characters), or you will break the
gif and reports.
Expand Down