示例#1
0
    def advance_on_tile(self, target_tile: TileModel) -> bool:
        """
        Advances the fire on the target tile.
        Determines whether a flare up should
        occur or not after this instance of
        Advance Fire is done.

        :param target_tile:
        :return: boolean which tells us if a flare up will occur
        """
        flare_up_will_occur = False
        if target_tile.is_hotspot:
            flare_up_will_occur = True

        tile_status = target_tile.space_status

        # Safe -> Smoke
        if tile_status == SpaceStatusEnum.SAFE:
            target_tile.space_status = SpaceStatusEnum.SMOKE

        # Smoke -> Fire
        elif tile_status == SpaceStatusEnum.SMOKE:
            target_tile.space_status = SpaceStatusEnum.FIRE

        # Fire -> Explosion
        else:
            self.explosion(target_tile)

        return flare_up_will_occur
    def _perform_fire_hotspot_explosion(
            self, tile: TileModel, advance_event: EndTurnAdvanceFireEvent):
        """
        Set the tile on fire, turn hotspot to true and
        cause an explosion on that tile.

        :param tile: Target tile
        :param advance_event: Advance event to access explosion
        :return:
        """
        tile.space_status = SpaceStatusEnum.FIRE
        tile.is_hotspot = True
        advance_event.explosion(tile)