Hi, I’m working on refactoring code for an assignment. In this particular spot, I’m modifying a for loop.
Initially, the code was written with array lists for “object_type”, “object_PosX”, “object_PosY”, etc. All values had to be manually inputted.
I’ve reworked it by adding an “object” class that uses the builder method, allowing object types, positions, etc. to be assigned with less code.
I am not very good with lists and for-loops, but I believe that at this spot, the goal is to execute code for each object type, thus getting the number of object types, hence the use of the “.size()” method. However, after rewriting it so that it fits my new code, the size method loses its function. Any tips on how I should be writing this?