Java Day Convert To daysToTicks(double x)

Here you can find the source of daysToTicks(double x)

Description

D&D days to ticks (5 hours per MC 'day')

License

LGPL

Declaration

public static int daysToTicks(double x) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static final int TICKS_PER_SEC = 20;
    public static final int SEC_PER_MIN = 15;
    public static final int MIN_PER_HOUR = 10;
    public static final int HOUR_PER_DAY = 8;

    /** D&D days to ticks (5 hours per MC 'day') **/
    public static int daysToTicks(double x) {
        return hoursToTicks(x * HOUR_PER_DAY);
    }/*from  w  w  w .  j ava 2  s . c o  m*/

    /** D&D hours to ticks (15 minutes per MC 'hour') **/
    public static int hoursToTicks(double x) {
        return minutesToTicks(x * MIN_PER_HOUR);
    }

    /** D&D minutes to ticks (16 seconds per MC 'minute') **/
    public static int minutesToTicks(double x) {
        return secondsToTicks(x * SEC_PER_MIN);
    }

    /** standard MC ratio **/
    public static int secondsToTicks(double x) {
        return (int) x * TICKS_PER_SEC;
    }
}

Related

  1. day2doy(int year, int month, int mday)
  2. day2msec(int day)
  3. day2String(int dayofweek)
  4. daysToSecs(long days)
  5. daysToYears(int days)