I have several matrices, but I want to simplify something. I have certain zones separated by variables, for example, the variable "zona_inv" which belongs to the inventory matrix and the variable "zona_hotbar" in the Hotbar matrix.
But I'm going to have another matrix, for example, let's call it matrix "X" and it's in zona_X.
If I want to store some information in the Hotbar matrix and another part of the information in another matrix, but only by comparing the zones, I want it to be saved in the corresponding matrix.
That is, if the zone is Zona_INV, the information should be saved in the INV matrix.
But if the zone were Zona_X, it should be saved in the X matrix.
I'm not sure if I'm explaining myself clearly. If I don't find a way to simplify this, I'll have to add more programming to save the data where it belongs, making many comparisons, but I want to know which zone it belongs to and save it in.
I need help with this or any ideas. Thanks.