MegaGameSociety / WatchTheSkiesDashboard

Watch the Skies Dashboard
1 stars 2 forks source link

Move income levels to credits structure to dedicated place #55

Open FifthSurprise opened 8 years ago

FifthSurprise commented 8 years ago

Currently the Income Levels are stored on database but the conversion from that to Credits is just put in a hash in GamesController#human_control. Also it exists in api controller.

This is bad for two reasons: 1.) Changes to how much income level affects credits received have to made in a controller method 2.) As part of #49, we can now potentially allow for custom team/countries. They would also need to have their own IncomeLevel to Credit rates provided/stored somewhere. No longer a thing because custom team/countries is waaaaaay too complicated.

I am thinking that the basic Income Levels for the standard countries can just be stored in a JSON or YML file or perhaps in Income.rb. Then on a per game level, we could reset the income levels for default countries.

Please note that right now the Team and Team Role models are just unique categorizations. So a join table may need to be created for a game in which you store the income levels.

gsaint commented 7 years ago

https://github.com/MegaGameSociety/WatchTheSkiesDashboard/pull/81/files