Arodang / Moroja

http://arodang.github.io/Moroja/app/index.html
MIT License
2 stars 0 forks source link

Add Time Service #11

Open Arodang opened 7 years ago

Arodang commented 7 years ago

Rewrite the Time Service in Angular2

Each action in Moroja should take some amount of game time to complete. Time should be kept on a 24h clock along with a counter for which day it is. This can be seen on the existing app here. As gather actions are done, the time ticks forward.

In the existing app (the dev branch) this code exists in the shared TimeService and is displayed in lines 5 and 6 of the Village Page, backed by the VillageController.

In the Angular2 rewrite (the ng2 branch) the time service should go into a "time" folder within the moroja/src/app/shared folder. Inside the folder you should make a service to do any calculations and such operations, and a component to display the time (this should be similar to lines 5 and 6 of the Village Page). I had created a Time Service in the shared/services folder but you can delete this and replace it with a version in the "time" folder instead.

As an extra step you could also display the time above the village in the main App Component.