예제 #1
0
파일: Model.py 프로젝트: mileshampson/Thor
 def __init__(self, location, team):
     self.colour = ConfigReader.getColourForId(team)
     self.view = PieceView(self.colour, (location,))
     self.location = location
     self.moves = 2
     self.moveColour = ConfigReader.getColourForId(team+"Moving")
     self.team = team
예제 #2
0
 def selectEvent(self, tilePosition):
     self.clearSelectEvent()
     if self.piecesModel.isPieceAt(tilePosition):
         logging.debug("Select event for %s", tilePosition)
         pieceData = self.piecesModel.getDataForPiecesAt(tilePosition)[0]
         self.moveSelectionsModel = self.selectionController.setSelectedTile(
             tilePosition, colour=ConfigReader.getColourForId("SelectedTile")
         )
         self.selectionController.setInfoTiles(
             self.tilePositionModel.positionsOnBoardIn(HexCoordSys.getTilesWithin(pieceData.moves, tilePosition)),
             self.moveSelectionsModel,
             ConfigReader.getColourForId("Info1Tile"),
             type(OverlayView((), ())),
         )
         self.pathSelectionModel = self.selectionController.setSelectedTile(tilePosition)
예제 #3
0
파일: View.py 프로젝트: mileshampson/Thor
 def __init__(self, tilePosition):
     self.surface = pygame.image.load("./hextile.png").convert()
     self.surface.set_colorkey(ConfigReader.getColourForId('TRANSPARENT_COLOR_KEY'), RLEACCEL)
     self.boundingBox = self.surface.get_rect()
     self.boundingBox.center = HexCoordSys.hexToPixel(tilePosition, TILE_EDGE_LENGTH, CENTER)
     self.views = []
     self.addView(TextView("%d,%d" % (tilePosition.row, tilePosition.col)))
     self.tilePosition = tilePosition
예제 #4
0
파일: View.py 프로젝트: mileshampson/Thor
 def __init__(self):
     self.surface = pygame.image.load("./hexcursor.png").convert()
     self.surface.set_colorkey(ConfigReader.getColourForId('TRANSPARENT_COLOR_KEY'), RLEACCEL)
     self.boundingBox = self.surface.get_rect()
     self.tilePosUnderCursor = None
     self.setPosition(0,0)
예제 #5
0
파일: View.py 프로젝트: mileshampson/Thor
 def __init__(self, text):
     self.surface = pygame.font.Font(pygame.font.get_default_font(),12).render(text, 0, ConfigReader.getColourForId('WHITE'))
     self.boundingBox = self.surface.get_rect()
     self.setPosition(0,0)
예제 #6
0
파일: View.py 프로젝트: mileshampson/Thor
 def clearSurface(self):
     self.drawOn.fill(ConfigReader.getColourForId('LIGHT_GREY'))