youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Introduced abstract base class for infection model + a nasty bug fix #43

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi, since we're experimenting with different infection models, I've removed the infection code from HumanBase and created an abstract base class AbstractInfection. The existing, probability-based infection has been moved to ProbabilityBasedInfection.cs, all in the Infection folder. The infection model can simply be attached to the Human as another component, as I already did to the prefabs.

Also, Unity Script Execution order sometimes caused the End Game Controller to finish the game before it has even started. I solved this by introducing the EndGameController.InitComplete() method. The controller's update method will now do nothing before InitComplete is called.

@maccxs If you've already written code for your SEIR model, could you also move it to a class derived from AbstractInfection? This way, switching between models becomes most easy.