Esempio n. 1
0
    def load_blocks(self, blocks):
        """
        Load a list of lists as all blocks.

        This should be only called internally by pylazors module since it will not perform any
        checks for performance reasons.
        """

        self._blocks = deepcopy(blocks)
Esempio n. 2
0
    def load_laser_segments(self, laser_segments):
        """
        Load a list of tuples as all laser path segments.

        This should be only called internally by pylazors module since it will not perform any
        checks for performance reasons.
        """

        self._laser_segments = deepcopy(laser_segments)
Esempio n. 3
0
    def copy(self,
             with_blocks=True,
             with_laser_sources=True,
             with_targets=True,
             with_available_blocks=True,
             with_laser_segments=True):
        """ Return a copy of this board """

        new_board = Board(self.name, self.width, self.height)
        if with_blocks:
            new_board._blocks = deepcopy(self._blocks)
        if with_laser_sources:
            new_board._laser_sources = deepcopy(self._laser_sources)
        if with_targets:
            new_board._targets = deepcopy(self._targets)
        if with_available_blocks:
            new_board._available_blocks = deepcopy(self._available_blocks)
        if with_laser_segments:
            new_board._laser_segments = deepcopy(self._laser_segments)
        return new_board
Esempio n. 4
0
    def get_targets(self):
        """ Return all target points. """

        return deepcopy(self._targets)
Esempio n. 5
0
    def get_blocks(self):
        """ Return a list of lists of all blocks. """

        return deepcopy(self._blocks)
Esempio n. 6
0
    def get_available_blocks(self):
        """ Return a list of all movable blocks """

        return deepcopy(self._available_blocks)
Esempio n. 7
0
    def get_laser_sources(self):
        """ Return all laser path segments """

        return deepcopy(self._laser_sources)