Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/definitions #328

Open
wants to merge 8 commits into
base: feature/crafting
Choose a base branch
from
Open

Conversation

susch19
Copy link
Member

@susch19 susch19 commented Dec 18, 2024

  • Lese Dir die Contribution Datei durch.
  • Beachte den Code of Conduct.
  • Damit der Pull Request angenommen wird, muss er unserem Code Style entsprechen.
  • Schreibe einen aussagekräftigen Titel und eine kurze Zusammenfassung was Du geändert hast.

susch19 and others added 8 commits July 7, 2024 21:44
* Improved custom type support for definition extensions
* removed BaseRegistrar, since this class did nothing

Co-authored-by: Marcus Aurelius <[email protected]>
* Auto generate first draft of the json definitions
* Register all Definitions on the Registrar base on types to get them in the manager
* Create all required base type definition classes to deal with them in the future

Co-authored-by: susch19 <[email protected]>
* because we needed more type information inside the json
* deserialize the json and therefore the definitions, so that we can continue to get octo awesome running again
* move definitionsmanager ctor into initializer, so we have no ring references and the ctor doesn't do more than it should
* so that the serialized definitions are loaded into the game and are able to be used for rendering and game logic
* reimplement tree logic, since these weren't "real" definitions, but rather code in a definitions class
* centralized the deserialized registration for definitions, so that mods can have their own base types without needing to implement a lot of specific code
* add an action service, so that one can implement custom logic for specific definitions as function or action
* store and load definition indices, so that even if a mod adds new types, the worlds should be compatible with our serialization format and otherwise we now have the possibility to warn about incompatibility
* so that it works with the new definition json
* add new network block definition, so that we can deserialize the INetworkBlock Definition into our new system
* register all the node types into our definition action service, so it is more generic and at the same place as the other definition extension methods
* add methods to definition action service without additional parameters, if you just want to return something or act on something specific
* migrate all the item definitions with can mine and register create item, so that we could remove those as well
* remove all the block and material definitions, since they are now unused
* fix the places where we used the old way of definitions and methods on the definitioins
* add burnable definition, so that we can use this for furnace fuel, instead of relying on solid blocks density
* so that the definitions are converted to const strings for typo safety
* use the newly generated const strings
* create a seperate const strings file for things like methods and the special hand item
* so we know the runtime type variations of a specific definition and therefore have something similar to the ore dict of a similar game
* Use ConstStrings in more places, so we reduce the chance of typo or rename errors
* only create items based on there actual material, so we don't end up with food material axe for example
* add grouping to actions, so that we can remove the complete group at the dispose of the registering component, so that we don't end up firing the same event twice after reload of save game
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants