SHARE
TWEET

Untitled

a guest Oct 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python3
  2. from player import Player
  3.  
  4. class Area:
  5.     def __init__(self, point1, point2, owner):
  6.         self.point1 = point1
  7.         self.point2 = point2
  8.         self.owner = owner
  9.        
  10.     def get_point1(self):
  11.         return self.point1
  12.        
  13.     def get_point2(self):
  14.         return self.point2
  15.        
  16.     def get_owner(self):
  17.         return self.owner
  18.        
  19.     def get_size_x(self):
  20.         return abs(self.point1.get_x() - self.point2.get_x())
  21.    
  22.     def get_size_z(self):
  23.         return abs(self.point1.get_z() - self.point2.get_z())
  24.        
  25.     def is_player_inside(self, player):
  26.         pX = abs(player.get_position().get_x())
  27.         pZ = abs(player.get_position().get_z())
  28.        
  29.         return (pX > abs(self.point1.get_x()) and pX < abs(self.point2.get_x())
  30.             and pZ > abs(self.point1.get_z()) and pZ < abs(self.point2.get_z()))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top