def is_infront_of(self, other_entity): if not isinstance(other_entity, AbstractEntity): raise TypeError("is_infront_of() parameter other_entity={0} is not a subclass of AbstractEntity".format(other_entity)) origin = Point() other = self.translation_to(other_entity) return GeomMath.is_infront_of(other, origin)
def is_infront_of(self, other_entity): if not isinstance(other_entity, AbstractEntity): raise TypeError( "is_infront_of() parameter other_entity={0} is not a subclass of AbstractEntity" .format(other_entity)) origin = Point() other = self.translation_to(other_entity) return GeomMath.is_infront_of(other, origin)
def test_is_infront_of(self): self.assertTrue(GeomMath.is_infront_of(self.infront, self.center)) self.assertFalse(GeomMath.is_infront_of(self.behind, self.center))