Exemple #1
0
    def assert_schematics_equal(self, a, b):
        """Check equality between two list[(xyz, idm)] schematics

        N.B. this compares the shapes and idms, but ignores absolute position offsets.
        """
        a, _ = to_relative_pos(a)
        b, _ = to_relative_pos(b)
        self.assertEqual(set(a), set(b))
Exemple #2
0
    def undo(self, agent):
        agent.send_chat("ok I will build it back.")

        # if rebuilding an object, get old object tags
        schematic_tags = [(pred, obj) for _, pred, obj in self.destroyed_block_object_triples]

        # push Build task to stack
        schematic, origin = to_relative_pos(self.schematic)
        agent.memory.task_stack_push(
            Build(
                agent,
                {
                    "blocks_list": schematic,
                    "origin": origin,
                    "force": True,
                    "verbose": False,
                    "schematic_tags": schematic_tags,
                },
            ),
            parent_memid=self.memid,
        )