コード例 #1
0
    def remove_cell(self, cell):
        """Remove a map cell from the path and return it."""

        if not self.has_cell(cell):
            raise error.GameMapError("The cell is not in the path.")

        return self.cells.pop(self.cells.index(cell))
コード例 #2
0
    def add_cell(self, cell):
        """Add a map cell to the path."""

        if self.has_cell(cell):
            raise error.GameMapError("The cell is already in the path.")

        self.cells.append(cell)
コード例 #3
0
    def remove_artifact(self, artifact):
        """Removes the interface from the map cell"""

        if artifact not in self.artifacts:
            raise error.GameMapError(
                "The artifact is not assigned to the map cell.")

        return self.artifacts.pop(self.artifacts.index(artifact))
コード例 #4
0
    def remove_part(self, part):
        """Removes the interface from the map cell"""

        if part not in self.parts:
            raise error.GameMapError(
                "The part is not assigned to the map cell.")

        return self.parts.pop(self.parts.index(part))
コード例 #5
0
    def add_artifact(self, artifact):
        """Adds a tool to the map cell."""

        if artifact in self.artifacts:
            raise error.GameMapError(
                "The artifact is already assigned to the map cell.")

        self.artifacts.append(artifact)
コード例 #6
0
    def add_part(self, part):
        """Adds a tool to the map cell."""

        if part in self.parts:
            raise error.GameMapError(
                "The part is already assigned to the map cell.")

        self.parts.append(part)
コード例 #7
0
    def remove_tool(self, tool):
        """Removes the interface from the map cell"""

        if tool not in self.tools:
            raise error.GameMapError(
                "The tool is not assigned to the map cell.")

        return self.tools.pop(self.tools.index(tool))
コード例 #8
0
    def add_tool(self, tool):
        """Adds a tool to the map cell."""

        if tool in self.tools:
            raise error.GameMapError(
                "The tool is already assigned to the map cell.")

        self.tools.append(tool)
コード例 #9
0
    def remove_device(self, device):
        """Removes the interface from the map cell and returns it."""

        if device not in self.interfaces:
            raise error.GameMapError(
                "The device is not assigned to the map cell.")

        return self.devices.pop(self.devices.index(device))
コード例 #10
0
    def add_device(self, device):
        """Adds an interface to the map cell."""

        if device in self.devices:
            raise error.GameMapError(
                "The device is already assigned to the map cell.")

        self.devices.append(device)