Moving-Castles / this-cursed-machine

Body horror fulfilment center simulator
MIT License
23 stars 3 forks source link

LibMaterial #247

Closed dk1a closed 1 month ago

dk1a commented 1 month ago

A general library for all material tokens I plan to continue in the next PR to make reviewing easier

Special cases like BUGS, which need to be hardcoded in some places, can use the init library's id, e.g. PublicMaterials.BUGS The idea is to add Season1Materials to the private repo with all the other mats, removing the enum in the process and replacing MaterialType with MaterialId everywhere

I chose a nonstandard name for PublicMaterials due to it being an enum alternative, as well as an init lib, but feel free to ask for other names for anything

MaterialId is meant to be equal to the token namespace for ease of identification (hence bytes14) t_BUG - I mean to add little prefixes to minimize namespace conflicts, though maybe that's excessive

pwrstudio commented 1 month ago

Look great.

To make sure I understand correctly:

dk1a commented 1 month ago

Look great.

To make sure I understand correctly:

  • We remove the hardcoded MaterialType enum.
  • Instead we register materials (at deploy or later) and use the materialIDto identify them (in recipes, orders etc...)
  • When a player ships a user-created order we mint tokens of that material to the creator of the order.

Yep As opposed to enum, they will be easier to add and not limited to 255

pwrstudio commented 1 month ago

great. feel free to proceed.