I have 2 separate array lists. one called spawnList and another called foundList
I have the code run through, it spawns an entity and adds said entity ID to the spawnList, so now spawnList.size() will equal 1
Next run through it clears the foundList searches for entities and compares what it found to the spawnList, any matches are added to the foundList.
the weird issue I am having is when the foundList is cleared so is the spawnList
I narrowed it down and put some print outs to test
System.out.println("spawnList = " + this.spawnList.size());
this.foundList.clear();
System.out.println("spawnList = " + this.spawnList.size());
This will print out
spawnList = 1
spawnList = 0
Why is the spawnList being cleared when the foundList is being cleared?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…