renamed 'Position' to 'BlockPos'
This commit is contained in:
parent
8ac1cbfd6a
commit
900b300f66
1 changed files with 9 additions and 1 deletions
|
@ -1,12 +1,20 @@
|
|||
from math import sqrt
|
||||
from enum import Enum
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass # TODO use the one from types
|
||||
class Position:
|
||||
class BlockPos:
|
||||
x : float
|
||||
y : float
|
||||
z : float
|
||||
|
||||
def distance(self, p:'BlockPos'):
|
||||
return sqrt(
|
||||
( self.x - p.x ) ** 2 +
|
||||
( self.y - p.y ) ** 2 +
|
||||
( self.z - p.z ) ** 2
|
||||
)
|
||||
|
||||
class Dimension(Enum):
|
||||
NETHER = -1
|
||||
OVERWORLD = 0
|
||||
|
|
Loading…
Reference in a new issue