Skip to content

Conversation

Cerzi
Copy link

@Cerzi Cerzi commented Mar 29, 2019

A very simple modified version of PoolableManager that allows a facade class to forward an initialization parameter to objects in the subcontainer that implement IPoolable<T>.

This enables a clean way for all subcomponents to access the param data sent to the facade OnSpawned:

public void OnSpawned(ParamData data, IMemroyPool pool)
{
   _pool = pool;
   _customPoolableManager.TriggerOnSpawned(data);
}

//subcomponent.cs
public void OnSpawned(ParamData data)

Rather than having to do something like

public void OnSpawned() 
{
   _data = _facade.GetData();
}

in every subcomponent, which feels like a limitation of the current PoolableManager.

@svermeulen
Copy link

Makes sense, thanks. I've merged this into extenject with commit 226c911. I also added documentation for it

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