Revolutionary-Games / Thrive

The main repository for the development of the evolution game Thrive.
https://revolutionarygamesstudio.com/
Other
2.78k stars 495 forks source link

Species `OnEdited` should ensure `IsBacteria` is always up to date #5304

Open hhyyrylainen opened 1 month ago

hhyyrylainen commented 1 month ago

to ensure there's no editing or mutation bugs that don't correctly update the bacteria-ness of a species

EuroBlue commented 1 month ago

What do you mean with up to date?

hhyyrylainen commented 1 month ago

The species class does not update public bool IsBacteria { get; set; } so after an update of the organelles there is a potential bug if the updating code forgot to update the IsBacteria property.

It would be better if the species object took care of making sure there can not be a situation where the organelles are updated but the IsBacteria property is not and has an old value.