mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
LTTP: Rip Lttp specific entrance code out of core and use Region helpers (#1960)
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from enum import IntEnum
|
||||
|
||||
from BaseClasses import Location, Item, ItemClassification, Region, MultiWorld
|
||||
from BaseClasses import Entrance, Location, Item, ItemClassification, Region, MultiWorld
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .Dungeons import Dungeon
|
||||
from .Regions import LTTPRegion
|
||||
|
||||
|
||||
class ALttPLocation(Location):
|
||||
@@ -77,6 +76,19 @@ class ALttPItem(Item):
|
||||
return self.type
|
||||
|
||||
|
||||
Addresses = int | list[int] | tuple[int, int, int, int, int, int, int, int, int, int, int, int, int]
|
||||
|
||||
|
||||
class LTTPEntrance(Entrance):
|
||||
addresses: Addresses | None = None
|
||||
target: int | None = None
|
||||
|
||||
def connect(self, region: Region, addresses: Addresses | None = None, target: int | None = None) -> None:
|
||||
super().connect(region)
|
||||
self.addresses = addresses
|
||||
self.target = target
|
||||
|
||||
|
||||
class LTTPRegionType(IntEnum):
|
||||
LightWorld = 1
|
||||
DarkWorld = 2
|
||||
@@ -90,6 +102,7 @@ class LTTPRegionType(IntEnum):
|
||||
|
||||
|
||||
class LTTPRegion(Region):
|
||||
entrance_type = LTTPEntrance
|
||||
type: LTTPRegionType
|
||||
|
||||
# will be set after making connections.
|
||||
|
Reference in New Issue
Block a user