def test_cone(self): beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[4], 2) self.assertEqual(39, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[3], 2, 10) self.assertEqual(29, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[5], 4) self.assertEqual(75, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[5], 2) self.assertEqual(31, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[3], ORIGOS[6], 2) self.assertEqual(50, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[8], 1) self.assertEqual(9, len(beam)) beam = rlfl.project_cone(self.map, ORIGOS[1], ORIGOS[5], 2, 4) self.assertEqual(19, len(beam))
def show_cone(self, source, target, rad=2, rng=-1, flags=0): cone = rlfl.project_cone(self.mapnum, self.origos[source], self.origos[target], rad, rng, flags) self.print_map(cone, self.origos[source], self.origos[target])