题意:Java:可调整大小的 ArrayList 不会保持平行。
问题背景:
I have a situation where my 'agent' objects contain a vast amount of data, including graphics, physics, and now also ai.
我遇到了一个情况,我的 'agent' 对象包含大量数据,包括图形、物理和现在的 AI。
I was previously coding components of these 'agents' in separate objects, that were parallel. Now I realize, since the agents are contained in a re-sizable ArrayList, that if one of the agents is destroyed, the indices will no longer be parallel to the ai components.
我之前将这些 'agents' 的组件编码为独立的并行对象。现在我意识到,由于这些 agents 被包含在一个可调整大小的 ArrayList 中,如果其中一个 agent 被销毁,索引将不再与 AI 组件平行。
Truth be told, the agent c