问题描述
我有 N 个数组结构:
PlayerTable: ids,velocities,positions,animations,healths ...
EnemyTable: ids,AIs ...
BulletTables: ids,ranges ...
... other N-3 soas
我有 M 个程序来更新这些数组结构:
applyVelocities: [read] velocities,[write] positions
updateAnimations: [write] animations
drawEntities: [read] animations,[read] positions
... other M-3 procedures
是否有一种设计模式可以迭代 SoA 集合中所有相同类型的数组?
我可以考虑编写一个模板函数,并为具有这些属性的每个数组结构调用它。是这样吗?这通常可以很好地扩展吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)