pool: Reddo component-like fields

This commit is contained in:
Tom Wiesing 2022-12-22 13:49:05 +01:00
parent 99983ee6db
commit 337a5fbeba
No known key found for this signature in database
48 changed files with 291 additions and 163 deletions

View file

@ -105,6 +105,11 @@ func (di *delayedInit[Component]) Run(all []Component) {
// - A pointer to a struct type that implements component
// - A slice type of an interface type that implements component
//
// Such component-like fields are only initialized if one of the following conditions are met:
//
// - The field has a tag 'auto' with the value `true`
// - The field lives inside a struct field named `Dependencies`
//
// These fields are initialized in an undefined order during initialization.
// The init function may not rely on these existing.
// Furthermore, the init function may not cause other components to be initialized.