Class instances and object pool issues
Ok, so I am instantiating object pools to help me manage state for the mod. Here is a basic run-down of how I am doing it:
Code:
HF_ObjectPool = { Code:
HF_GroupPool = HF_ObjectPool.new(HF_Group); The issue I am having in theory is this: This works fine. Unique keys, the new things get placed in the inUse table on each with helpers I didn't include. Yay. Code:
PoolA['thing1'] = HF_Thing.new('thing1'); Code:
PoolA['thing1'] = HF_Thing.new('thing1'); function Class.someFunction() Would it make a difference to make local classes then assign them to props when I "new" an "instance"? Would making them local do anything? I'm new to Lua so I'm not sure why table refs are bleeding between tables. |
Actually might have figured it out. Seems like I tricked myself into thinking I was making real instances when really its all part of a larger table. So I cannot use generic "classes" or else they will clobber each-other. I need to make an object pool specific to each type of object.
Bummer too, it had some fancy engineering in it. |
All times are GMT -6. The time now is 09:06 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI