From 2f04b93fdb16d932c9371a9adea41665db9ac5ba Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 10 Oct 2021 14:03:33 +0200 Subject: [PATCH] api.md: add set Location.event in location skeleton --- docs/api.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index da07bd98..b498c8c7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -202,13 +202,14 @@ from BasClasses import Location class MyGameLocation(Location): game: str = "My Game" + + # override constructor to automatically mark event locations as such + def __init__(self, player: int, name = '', code = None, parent = None): + super(MyGameLocation, self).__init__(player, name, code, parent) + self.event = code is None ``` in your `__init__.py` or your `Locations.py`. -**FIXME**: Is setting Location.event actually required? Minecraft and OoT -do that. Factorio does not. What's the goal of doing that? When factorio places -a locked item this will do Location.event = item.advancement. - ### Options By convention options are defined in `Options.py` and will be used when parsing