def render(self, *discarded) -> None:
        rv = self.get_renderer_view()

        for p in self.__cube_colours:
            rv.cube_requires_update(p)
        self.__cube_colours.clear()

        p3 = rv.to_point3

        self.__cube_colours[p3(self._map.agent)] = self.__agent_colour()
        self.__cube_colours[p3(self._map.goal)] = self.__goal_colour()

        tc = self.__trace_colour()
        for trace_point in self._map.trace:
            self.__cube_colours[p3(trace_point)] = tc
        if len(self._map.trace) >= 1:
            self.__cube_colours[p3(
                Entity(self._map.trace[0].position,
                       self._map.agent.radius))] = self.__agent_colour()

        for p in self.__cube_colours:
            rv.cube_requires_update(p)
Exemple #2
0
 def test_ne_instance(self) -> None:
     entity1: Trace = Trace(Point(2, 3))
     entity2: Entity = Entity(Point(2, 3), 1)
     self.assertNotEqual(entity1, entity2)
Exemple #3
0
 def test_ne_instance(self) -> None:
     entity1: Agent = Agent(Point(2, 3), 10)
     entity2: Entity = Entity(Point(2, 3), 10)
     self.assertNotEqual(entity1, entity2)
Exemple #4
0
 def test_copy(self) -> None:
     entity1: Entity = Entity(Point(2, 3), 10)
     entity2: Entity = copy.copy(entity1)
     self.assertEqual(entity1, entity2)
Exemple #5
0
 def test_ne_all(self) -> None:
     entity1: Entity = Entity(Point(2, 3), 10)
     entity2: Entity = Entity(Point(2, 15), 15)
     self.assertNotEqual(entity1, entity2)
Exemple #6
0
 def test_eq(self) -> None:
     entity1: Entity = Entity(Point(2, 3), 10)
     entity2: Entity = Entity(Point(2, 3), 10)
     self.assertEqual(entity1, entity2)
Exemple #7
0
 def test_str(self) -> None:
     entity: Entity = Entity(Point(2, 3), 10)
     self.assertEqual("Entity: {position: Point(2, 3), radius: 10}",
                      str(entity))
Exemple #8
0
 def test_ne_instance(self) -> None:
     entity1: ExtendedWall = ExtendedWall(Point(2, 3), 10)
     entity2: Entity = Entity(Point(2, 3), 10)
     self.assertNotEqual(entity1, entity2)