Hello everyone,
I'm looking for some suggestions for simplifying this section of code.
I have a series of objects which can be assigned to whatever slots the player wants. Those objects then have various states which need to be reflected to the player.
At the moment I have a global variable for each slot, which I then write the objects name into.
In the level, I have to manually check which object is in which slot, which is a really ugly and unwieldy way of doing things.
At the moment it looks like this:
System|Slot A = Object A - Do This
System|Slot A = Object B - Do This
System|Slot A = Object C - Do This
System|Slot A = Object D - Do This
System|Slot B = Object A - Do This
System|Slot B = Object B - Do This
System|Slot B = Object C - Do This
System|Slot B = Object D - Do This
System|Slot C = Object A - Do This
System|Slot C = Object B - Do This
System|Slot C = Object C - Do This
System|Slot C = Object D - Do This
ect. You get the picture.
This feels like a really awful and unwieldy way of doing things; can anyone point me in the direction of the better implementation? I'm clearly missing something simple here.
Thank you very much