def eraseDot(self, city, alpha):
     """
     Erases the dot for a single city.
     """
     if self.DRAW_DOTS:
         x, y = city.point
         if BugPath.isMac():
             CyEngine().addColoredPlot(x, y, self.INVISIBLE_COLOR,
                                       self.DOT_LAYER)
         else:
             CyEngine().addColoredPlotAlt(x, y, self.NO_DOT_STYLE,
                                          self.DOT_LAYER, "COLOR_BLACK",
                                          alpha)
 def drawDot(self, city, alpha):
     """
     Draws the dot for a single city.
     """
     if self.DRAW_DOTS:
         x, y = city.point
         colorInfo = gc.getColorInfo(city.color)
         if BugPath.isMac():
             color = colorInfo.getColor()
             CyEngine().addColoredPlot(
                 x, y, NiColorA(color.r, color.g, color.b, alpha),
                 self.DOT_LAYER)
         else:
             CyEngine().addColoredPlotAlt(x, y,
                                          self.DOT_STYLE, self.DOT_LAYER,
                                          colorInfo.getType(), alpha)
示例#3
0
 def removeSign(self):
     """
     Removes sign from the interface
     """
     if self.isAdded:
         CyEngine().removeSign(self.plot, self.playerType)
         self.isAdded = False
     else:
         BugUtil.debug("Tried to remove sign not added to interface")
 def drawCross(self, city, alpha):
     """
     Draws the cross for a single city.
     """
     x, y = city.point
     color = gc.getColorInfo(city.color).getType()
     layer = city.layer
     for dx, dy in self.BFC_OFFSETS:
         CyEngine().fillAreaBorderPlotAlt(x + dx, y + dy, layer, color,
                                          alpha)
示例#5
0
 def addSign(self):
     """
     Puts sign down on game interface
     """
     if not self.isAdded:
         if gc.getMap().plot(self.plotX,self.plotY):
             self.plot = gc.getMap().plot(self.plotX,self.plotY)
         else:
             BugUtil.debug("Invalid Plot for sign at " + str(self.plotX) + "," + str(self.plotY))
         self.playerType = gc.getGame().getActivePlayer()
         CyEngine().addSign(self.plot,self.playerType,self.text)
         self.isAdded = True
     else:
         BugUtil.debug("Tried to add sign already added to interface")
def AddCoordinateSignsToMap():
    """
	adds signs with the coordinates to the map so that potential starting positions can easier be modified

	Returns
	-------
	None.

	"""

    iHumanPlayer = -1
    for iCivs in xrange(gc.getMAX_CIV_PLAYERS()):
        pPlayer = gc.getPlayer(iCivs)
        if pPlayer.isHuman():
            iHumanPlayer = iCivs
            break
    for iX in xrange(CyMap().getGridWidth()):
        for iY in xrange(CyMap().getGridHeight()):
            pPlot = CyMap().plot(iX, iY)
            PrintString = "X = " + str(iX) + " Y = " + str(iY)
            CyEngine().addSign(pPlot, iHumanPlayer, PrintString)
 def dehighlightMoveArea(self):
     CyEngine().clearColoredPlots(self.PLE_HIGHLIGHT_PLOTS)
     return 1
 def highlightMoves(self):
     for plot, color in self.dPlotList.items():
         if color != self.COL_NO:
             CyEngine().addColoredPlotAlt(plot[0], plot[1], PlotStyles.PLOT_STYLE_TARGET, self.PLE_HIGHLIGHT_PLOTS, color, .5)
 def clearDotLayer(self):
     """
     Clears all the dots from screen.
     """
     CyEngine().clearColoredPlots(self.DOT_LAYER)
 def clearCrossLayer(self, layer):
     """
     Clears the indexed border layer.
     """
     CyEngine().clearAreaBorderPlots(layer)