add Get method to model registry

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-09-14 18:07:00 -04:00
parent 15d032459a
commit 53e23bb52a
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -234,6 +234,14 @@ func (r TModelRegistry) new_(n string) interface{} {
return nil
}
func (r TModelRegistry) Get(name string) *Model {
model, ok := r[name]
if !ok {
return nil
}
return model
}
// Model registers models in the ModelRegistry, where
// they can be accessed via a model's struct name
func (r TModelRegistry) Model(mdl ...any) {