def attack(self, target): self.validify() if not isinstance(target, Ship): raise TypeError('target should be of [Ship]') target.validify() return library.shipAttack(self._ptr, target._ptr)
def attack(self, Target): self.validify() if not isinstance(Target, Unit): raise TypeError('Target should be of [Unit]') Target.validify() return library.shipAttack(self.ptr, Target.ptr)