tadeaustria / EverdellScore

Serverless JS App for counting Everdell Score
https://tadeaustria.github.io/EverdellScore/
GNU General Public License v3.0
2 stars 3 forks source link

[PoC] Occupancy Rework #49

Open Dajakk opened 3 months ago

Dajakk commented 3 months ago

@tadeaustria Please take a look. This is still work in progress, complex occupancies for farms etc. are missing, I will add them if the idea is acceptable and once me and my family get over the sickness

General idea is to count occupancy for each card type and not for each card alone. This allows to write cleaner and more flexible code, for example handling of children will be trivial and won't need any extra variables

To do:

Dajakk commented 3 months ago

Hello @tadeaustria, Please take a look now. I've resolved some of the issues, I will take another look in the morning with the fresh mind. For the time being I had to add possibly temporary occupancy just for the calculation if the card can be added to town, this would be removed in the future. Also I've added 2 cards from glimmerlock, just to verify with unit tests if the occupancies are working correctly.

Things added:

TODO:

If you know any other use cases for unit tests please let me know, but I tried to cover as much as reasonably possible.