Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert more code to use new time classes #23327

Merged
merged 31 commits into from Apr 9, 2018

Conversation

Projects
None yet
2 participants
@BevapDin
Copy link
Contributor

commented Mar 30, 2018

Beside changing the type of some variables to time_point / time_duration, this changes calendar::print_time:

  • renamed to to_string (as it does not print like the curses functions).
  • moved the part that was printing in special format into "weather.cpp", as it's only used there.

@ZhilkinSerg ZhilkinSerg self-assigned this Mar 31, 2018

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Mar 31, 2018

Something is bad with time display, when using any watches:

game start:

image

3 steps north:

image

more steps:

image

image

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2018

I'm pretty sure there was another commit with fixes to display of seconds after I provided screenshots. Have you removed it?

@BevapDin BevapDin force-pushed the BevapDin:ryt branch Apr 4, 2018

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2018

Seconds are now displayed as multiples of 10, but there were multiples of 6 previously:

image

Was it intended?

BevapDin added some commits Jan 1, 2018

Change submap::turn_last_touched to be a time_point.
Also change its name to just `last_touched` as one does not need to know that it is (currently) based on the turn number.
Move include of "calendar.h" from "weather.h" into the cpp file.
Add required forward declarations instead.
Split calendar::print_time into two functions.
It was nearly always called with the default value for the parameter, so we now have a function that behaves the same, but does not take any parameter.
And the one place that called it with a different value now calls the other function instead.
Move calendar::print_time_just_hour as free function into weather.cpp
Change the parameter to be `time_point`.

Removed references to the game options as this is *only* used in the weather report which follows a strict format.
Change islot_comestible::spoils to be time_duration.
Note that the `assign` function takes care of the conversion from a plain number of hours in JSON to `time_duration` via the `factor` parameter (1 hours in this case).

@BevapDin BevapDin force-pushed the BevapDin:ryt branch to c06b59a Apr 7, 2018

@BevapDin

This comment has been minimized.

Copy link
Contributor Author

commented Apr 8, 2018

Was it intended?

It wasn't. I'm switching between two notebooks, one older than the other (a full build takes some hours), and was mixing up the branches.

@ZhilkinSerg ZhilkinSerg removed their assignment Apr 9, 2018

@ZhilkinSerg ZhilkinSerg merged commit b4a409f into CleverRaven:master Apr 9, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.05%) to 23.602%
Details
gorgon-ghprb Build finished.
Details

@BevapDin BevapDin deleted the BevapDin:ryt branch Apr 10, 2018

@@ -42,8 +42,7 @@ w_point weather_generator::get_weather( const tripoint &location, const calendar
double A( raw_noise_4d( x, y, z, modSEED ) * 8.0 );
double W;

const double now( double( t.turn_of_year() + to_turns<int>( calendar::season_length() ) / 2 ) /
to_turns<int>( calendar::year_length() ) ); // [0,1)
const double now( time_past_new_year( t ) / calendar::year_length() ); // [0,1)

This comment has been minimized.

Copy link
@ZhilkinSerg

ZhilkinSerg Apr 11, 2018

Contributor

@BevapDin: People say weather became somewhat colder (https://discourse.cataclysmdda.org/t/15260) and this line is likely candidate.

Shouldn't it be const double now( ( time_past_new_year( t ) + calendar::season_length() / 2 ) / calendar::year_length() ), actually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.