Kyjor / JulGame.jl

JulGame is a game engine based on the Julia programming language with the help of SDL2.
https://docs.kyjor.io/JulGame.jl
The Unlicense
94 stars 3 forks source link

Refactor/dispatch-component-functions #59

Closed mrufsvold closed 4 months ago

mrufsvold commented 4 months ago

Just a very small PR that moves the ownership of the functions that are used by the components up to the Component module. Then, each type of component defines a method dispatch for that same function.

This is important because as we move function calls out of the getproperty, you don't want to have collissions between a bunch of functions with the same names but all defined in different modules.

Now you can call Component.update(x) and Julia's runtime can lookup the appropriate method to call.