move more Factorio stuff around

This commit is contained in:
Fabian Dill
2021-06-11 18:02:48 +02:00
parent 760fb32016
commit 2c4c899179
7 changed files with 75 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
from BaseClasses import MultiWorld
class AutoWorldRegister(type):
world_types = {}
@@ -12,7 +13,7 @@ class AutoWorldRegister(type):
def call_single(world: MultiWorld, method_name: str, player: int):
method = getattr(world.worlds[player], method_name)
return method(world, player)
return method()
def call_all(world: MultiWorld, method_name: str):
@@ -24,14 +25,22 @@ class World(metaclass=AutoWorldRegister):
"""A World object encompasses a game's Items, Locations, Rules and additional data or functionality required.
A Game should have its own subclass of World in which it defines the required data structures."""
def __init__(self, player: int):
self.player = int
world: MultiWorld
player: int
def generate_basic(self, world: MultiWorld, player: int):
def __init__(self, world: MultiWorld, player: int):
self.world = world
self.player = player
# overwritable methods that get called by Main.py
def generate_basic(self):
pass
def generate_output(self, world: MultiWorld, player: int):
def set_rules(self):
pass
def create_regions(self, world: MultiWorld, player: int):
def create_regions(self):
pass
def generate_output(self):
pass