diff --git a/SimHoc.pyproj b/SimHoc.pyproj index d757efd..b8c7ad1 100644 --- a/SimHoc.pyproj +++ b/SimHoc.pyproj @@ -11,7 +11,7 @@ . SimHoc SimHoc - MSBuild|Hockey|$(MSBuildProjectFullPath) + MSBuild|hockey10|$(MSBuildProjectFullPath) true @@ -50,6 +50,15 @@ + + hockey10 + 3.10 + hockey10 (Python 3.10 (64-bit)) + Scripts\python.exe + Scripts\pythonw.exe + PYTHONPATH + X64 + Hockey 3.8 diff --git a/game.py b/game.py index c97044a..10a9a38 100644 --- a/game.py +++ b/game.py @@ -123,7 +123,8 @@ class Game(object): self.positionInPossession = SkaterPosition(random.sample([0, 1, 1, 3, 3, 4],1)[0]) #wingers are less likely to recieve the faceoff than defensemen self.playStopped = False winningPlayer = self.skatersInPossession()[SkaterPosition.C.value] - eventString = f"{self.clockToMinutesSeconds()} - {self.teamInPossession.shortname} {str(winningPlayer)} wins faceoff." + receivingPlayer = self.skatersInPossession()[self.positionInPossession.value] + eventString = f"{self.clockToMinutesSeconds()} - {self.teamInPossession.shortname} {str(winningPlayer)} wins faceoff to {str(receivingPlayer)}" self.eventLog.append(eventString) self.eventLogVerbose.append(eventString) self.clock -= random.randint(2,5) @@ -132,7 +133,7 @@ class Game(object): def saveMadeStop(self, shootingPlayer, shotType): """Stops play due to a save made by a goalie, and sets the faceoff dot to be used.""" self.playStopped = True - eventText = f"{self.clockToMinutesSeconds()} - {str(self.defendingGoalie)} saves shot from {str(shootingPlayer), stops play.}" + eventText = f"{self.clockToMinutesSeconds()} - {str(self.defendingGoalie)} saves shot from {str(shootingPlayer)}, stops play." self.eventLog.append(eventText) self.eventLogVerbose.append(eventText) options = [FaceoffDot.AwayZoneLeft, FaceoffDot.AwayZoneRight] if self.homeAttacking() else [FaceoffDot.HomeZoneLeft, FaceoffDot.HomeZoneRight] diff --git a/hocTests.py b/hocTests.py index ca9fe35..32403c2 100644 --- a/hocTests.py +++ b/hocTests.py @@ -127,4 +127,4 @@ class TestGame(object): self.Game.playStopped = True foResult = self.Game.event() #this doesnt return anything but it's nice to know what it's for I guess lines = self.Game.eventLogOut() - pass \ No newline at end of file + print(lines) \ No newline at end of file diff --git a/player.py b/player.py index af2c3e7..7d3f4b8 100644 --- a/player.py +++ b/player.py @@ -10,7 +10,7 @@ class Player(object): def __init__(self, name:str, number:int=0): if name is None: self.attributes = [] - elif len(name) > 30: + elif len(name) > 20: raise CreationError("Player name too long.") elif number < 0 or number > 99: raise CreationError("Player number not valid.") @@ -18,6 +18,8 @@ class Player(object): self.name = name self.attributes = self.loadAttributes() self.number = number + scoutLevel = 0 #how well scouted opposing team is; not changing + confidenceStage = 0 #how well the player can judge enemy skill; builds over game def loadAttributes(self): """Generates attributes based on name, or loads from database if present.""" @@ -62,10 +64,16 @@ class Player(object): def initials(self): names = self.name.split() outString = "" - for name in names: - outString += f"{name[0]}." + if len(names) >= 2: + for name in names: + outString += f"{name[0]}." + else: + outString = f"{self.name[:3]}." return outString + def predictOpposingAction(self, opposingSkater): + raise NotImplementedError() + def chooseAtkAction(self): raise NotImplementedError() @@ -81,6 +89,7 @@ class Goalie(Player): """A hockey player that *is* a goalie.""" pass + class AtkAction(Enum): SkateB = 0 SkateF = 1