renamed 'Position' to 'BlockPos'

This commit is contained in:
əlemi 2021-11-30 13:17:20 +01:00
parent 8ac1cbfd6a
commit 900b300f66

View file

@ -1,12 +1,20 @@
from math import sqrt
from enum import Enum from enum import Enum
from dataclasses import dataclass from dataclasses import dataclass
@dataclass # TODO use the one from types @dataclass # TODO use the one from types
class Position: class BlockPos:
x : float x : float
y : float y : float
z : 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): class Dimension(Enum):
NETHER = -1 NETHER = -1
OVERWORLD = 0 OVERWORLD = 0