This commit is contained in:
2026-03-14 21:31:00 -04:00
commit 571b4283c7
45 changed files with 2591 additions and 0 deletions

50
world/commons/field.py Normal file
View File

@@ -0,0 +1,50 @@
from abc import ABC, abstractmethod
from typing_extensions import override
from world.commons.field_landmarks import FieldLandmarks
class Field(ABC):
def __init__(self, world):
from world.world import World # type hinting
self.world: World = world
self.field_landmarks: FieldLandmarks = FieldLandmarks(world=self.world)
def get_our_goal_position(self):
return (-self.get_length() / 2, 0)
def get_their_goal_position(self):
return (self.get_length() / 2, 0)
@abstractmethod
def get_width(self):
raise NotImplementedError()
@abstractmethod
def get_length(self):
raise NotImplementedError()
class FIFAField(Field):
def __init__(self, world):
super().__init__(world)
@override
def get_width(self):
return 68
@override
def get_length(self):
return 105
class HLAdultField(Field):
def __init__(self, world):
super().__init__(world)
@override
def get_width(self):
return 9
@override
def get_length(self):
return 14