001package com.fs.starfarer.api.campaign;
002
003import java.util.GregorianCalendar;
004
005
006/**
007 * @author Alex Mosolov
008 *
009 * Copyright 2012 Fractal Softworks, LLC
010 */
011public interface CampaignClockAPI {
012        /**
013         * Displays the current year cycle.
014         * Example: outputs 206
015         * @return int value
016         */
017        public int getCycle();
018        /**
019         * 1 = January, 12 = December.
020         * @return int value
021         */
022        public int getMonth();
023        /**
024         * Get the day since game start. If game started 4 in-game days ago, it will return 4.0.
025         * Example: Global.getSector().getClock().getDay()
026         * @return int value
027         */
028        public int getDay();
029
030        /**
031         * Gives the hour of the day.
032         * Example: outputs 3 if 3rd hour of day.
033         * @return int value
034         */
035        public int getHour();
036        public float convertToDays(float realSeconds);
037        public float convertToMonths(float realSeconds);
038        /**
039         * Gets the timestamp of the current date as a 14 digit, negative signed long number. March 2, c206 is -55661253120000.
040         * Example: Global.getSector().getClock().getTimestamp()
041         * @return long value
042         */
043        public long getTimestamp();
044        /**
045         * Gets the time elasped after the specified timestamp.
046         * Example: Returns the time in float time. If partial day, it will return 0.5966898.
047         * @params long timestamp
048         * @return float value
049         */
050        public float getElapsedDaysSince(long timestamp);
051        /**
052         * Outputs the current in game month as a full string.
053         * @return String value
054         */
055        public String getMonthString();
056
057        /**
058         * Returns short hand string of the in game month.
059         * Example: Mar for March, Jun for June.
060         * @return String value
061         */
062        public String getShortMonthString();
063        public float getSecondsPerDay();
064        /**
065         * New clock based on the timestamp.
066         * @param timestamp
067         * @return
068         */
069        CampaignClockAPI createClock(long timestamp);
070        /**
071         * Outputs the current date in a string format.
072         * Example: output is Mar 2, c206.
073         * @return String value
074         */
075        String getDateString();
076        float convertToSeconds(float days);
077        /**
078         * Gets the short date in the format of cYYY.MM.DD.
079         * Example: Returns 206.3.3
080         * @return string value
081         */
082        String getShortDate();
083        /**
084         * Gets the cycle number in a string format
085         * Example: Returns 206
086         * @return string value
087         */
088        String getCycleString();
089
090        /**
091         * Returns the game calender using the Java.util.GregorianCalendar
092         * @return Java.util.GregorianCalendar[]
093         */
094        GregorianCalendar getCal();
095}