bool d_isHourRange (Critter& player, Critter@ npc, int fromHour, int toHour)
{
return (fromHour > toHour ? (fromHour >= __Hour || toHour <= __Hour) : (fromHour >= __Hour && toHour <= __Hour));
}
bool d_isHour (Critter& player, Critter@ npc, int hour)
{
return hour == __Hour;
}
bool d_isDay (Critter& player, Critter@ npc)
{
return d_isHourRange(player, npc, 8, 20);
}
bool d_isNight (Critter& player, Critter@ npc)
{
return !d_isDay(player, npc);
}
didn't test it but should work
you get 4 functions: d_isHourRange, d_isHour, d_isDay, d_isNight