gmich / Gem

A cross-platform game engine with GUI and multiplayer support using Monogame, Farseer and Lidgren

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add caching to prevent INetworkEvent reallocation

gmich opened this issue · comments

HandleWith(this,x=> new Action(x.Do));

cache the object's name as string , and the delegate's (x.Do) name as string
also cache the whole networkConfig (eventHandler etc).

When disposing an eventHandler, the cached entry should be removed as well

For a successful lookup, the networkConfig.INetworkHandler is returned.

It shouldn't be in a hashtable or a dictionary.
Use GenericRepository. The lookup should match both entries.