Beispiel #1
0
class BLOCK:
    # 地块环境
    ENVIRONMENT = [0, 1, 2, 3, 4]
    # 环境权重
    ENV_WEIGHT = calculate_weight(6, 20, 51, 15, 4)
    # 环境名词
    WORD = (tr(dt.ENV__2), tr(dt.ENV__1), tr(dt.ENV_0), tr(dt.ENV_1), tr(dt.ENV_2))
    # 地块颜色
    COLOR = (COLOR.ENV__2, COLOR.ENV__1, COLOR.ENV_0, COLOR.ENV_1, COLOR.ENV_2)
    # 地块修正
    MODIFIER = (-0.5, -0.25, 0, 0.25, 0.5)
Beispiel #2
0
 def display(self):
     return TEMPLATE_TECHNOLOGY.format(
         area=tr(self.area),
         technology=self.name,
         schedule=self.schedule,
         total=self.total
     )
Beispiel #3
0
    def draw(self, painter: QPainter):
        painter.setBrush(COLOR.WHITE)

        width_name = int(self.width * NUMBER.PANEL_NAME_PER)
        width_power = int(self.width * NUMBER.PANEL_POWER_PER)

        self.draw_power(painter, self.left, width_name, tr(self.name))
        self.draw_power(painter, self.left + width_name, width_power,
                        self.power)
Beispiel #4
0
    def draw(self, painter: QPainter):
        painter.setBrush(COLOR.WHITE)

        width_name = int(self.width * NUMBER.PANEL_NAME_PER)
        width_storage = int(self.width * NUMBER.PANEL_STORAGE_PER)
        width_daily = int(self.width * NUMBER.PANEL_DAILY_PER)

        self.draw_resource(painter, self.left, width_name, tr(self.name))
        self.draw_resource(painter, self.left + width_name, width_storage,
                           self.storage)
        self.draw_resource(painter, self.left + width_name + width_storage,
                           width_daily, self.daily)
Beispiel #5
0
 def display(self):
     modifier = 100 * BLOCK.MODIFIER[self.attribute.status]
     if self.attribute.display:
         return TEMPLATE_BLOCK.format(
             player=tr(dictionary.NO_PYALER) if self.player is None else self.player.name,
             ident=self.ident,
             row=self.row,
             col=self.col,
             env_desc=BLOCK.WORD[self.attribute.status],
             env_modifier=modifier,
             product_modifier=modifier,
             upkeep_modifier=-modifier
         )
     else:
         return "该地块不可见"
 def display(self):
     return TEMPLATE_FILTER.format(
         filter_type=tr(self.name)
     )
 def draw(self, painter: QPainter):
     painter.setBrush(COLOR.WHITE)
     rect = QRect(self.left, self.top, self.width, self.height)
     painter.drawRect(rect)
     draw_text(rect, tr(self.name), painter)
Beispiel #8
0
 def display(self):
     return tr(self.name)
Beispiel #9
0
 def display(self):
     return TEMPLATE_POWER.format(power=tr(self.name),
                                  power_number=self.power)
Beispiel #10
0
 def display(self):
     return TEMPLATE_RESOURCE.format(resource=tr(self.name),
                                     storage=self.storage,
                                     daily=self.daily,
                                     territory=10 - self.storage)