Skip to content

Commit

Permalink
Factor out the real and default season lengths
Browse files Browse the repository at this point in the history
Pull these values out as global statics to make it clearer that the
default season length is the real-world season length.
  • Loading branch information
jbytheway committed Dec 31, 2019
1 parent 514fedc commit 2569a21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/calendar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,16 @@ void calendar::set_season_length( const int dur )
cur_season_length = dur;
}

static constexpr int real_world_season_length = 91;
static constexpr int default_season_length = real_world_season_length;

float calendar::season_ratio()
{
static const int real_world_season_length = 91;
return to_days<float>( season_length() ) / real_world_season_length;
}

float calendar::season_from_default_ratio()
{
static const int default_season_length = 91;
return to_days<float>( season_length() ) / default_season_length;
}

Expand Down

0 comments on commit 2569a21

Please sign in to comment.