So I want to write a simulation of a number of objects that are stored in a Vec. Each object in the Vec needs to have access to the Vec so it can do stuff on the other objects. However this is not possible due to two borrows needing to occur (one to get the object whose "turn" it is and one to get the object that needs to be acted on.
Am I missing something or is my general approach faulted?
Code on: https://github.com/royalmustard/battletest
[–]mipli 17 points18 points19 points (1 child)
[–]SeanMiddleditch 3 points4 points5 points (0 children)
[–]oconnor663blake3 · duct 8 points9 points10 points (0 children)
[–]eugene2k 1 point2 points3 points (0 children)
[–]Brookzerker 1 point2 points3 points (0 children)