Пример #1
0
    def is_behind(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError(
                "is_behind() parameter other_entity={0} is not a subclass of AbstractEntity"
                .format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.is_behind(other, origin)
Пример #2
0
 def test_is_behind(self):
     self.assertTrue(GeomMath.is_behind(self.behind, self.center))
     self.assertFalse(GeomMath.is_behind(self.infront, self.center))