Archipelago icon indicating copy to clipboard operation
Archipelago copied to clipboard

WebHost, Core: Move item and location descriptions to `WebWorld` responsibilities.

Open ThePhar opened this issue 1 year ago • 2 comments

What is this fixing or adding?

Moving these changes from World to WebWorld to remove responsibility of these from core to WebHost.

~~Also includes some optimizations.~~

How was this tested?

Migrated tests and ran tests. Also ensured functionality remained the same.

If this makes graphical changes, please attach screenshots.

image

ThePhar avatar Nov 25 '23 20:11 ThePhar

The implementation is flawed, it tries to control what should be a ClassVar using @property getters and setters (which affect an instance attribute).

Debugging reveals that

  • DarkSouls3World.web.item_descriptions contains only "Cinders"
  • DarkSouls3World.web._item_descriptions contains only "Everything"

That is because the initial assignment goes directly to the type and creates item_descriptions there (overwriting the property with a plain dict), while the property setter ended up never being called and therefore _item_descriptions was never modified. You'll have to rethink that whole design. (Using @classmethod @property isn't a viable alternative because that was only supported in a narrow interval of Python versions and has since been forbidden again.)

el-u avatar Nov 26 '23 13:11 el-u

Updated PR and fixed merge conflicts.

ThePhar avatar Apr 21 '24 00:04 ThePhar