Table of Contents

Struct GameDateTime

Namespace
S1API.GameTime
Assembly
S1API.dll

Represents an in-game datetime (elapsed days and 24-hour time).

public struct GameDateTime
Inherited Members
Extension Methods

Constructors

GameDateTime(GameDateTime)

Constructs a GameDateTime from the internal GameDateTime struct.

public GameDateTime(GameDateTime gameDateTime)

Parameters

gameDateTime GameDateTime

GameDateTime(GameDateTimeData)

Constructs a GameDateTime from an internal GameDateTimeData.

public GameDateTime(GameDateTimeData data)

Parameters

data GameDateTimeData

GameDateTime(int)

Constructs a GameDateTime from total minutes.

public GameDateTime(int minSum)

Parameters

minSum int

GameDateTime(int, int)

Constructs a GameDateTime from elapsed days and 24-hour time.

public GameDateTime(int elapsedDays, int time)

Parameters

elapsedDays int
time int

Fields

ElapsedDays

public int ElapsedDays

Field Value

int

Time

public int Time

Field Value

int

Methods

AddMinutes(int)

Returns a new GameDateTime with additional minutes added.

public GameDateTime AddMinutes(int minutes)

Parameters

minutes int

Returns

GameDateTime

GetFormattedTime()

Returns the current time formatted as a 12-hour AM/PM string. Example: "12:30 PM"

public string GetFormattedTime()

Returns

string

GetMinSum()

Returns the total minute sum (days * 1440 + minutes of day).

public int GetMinSum()

Returns

int

IsNightTime()

Returns true if the time is considered nighttime. (Before 6AM or after 6PM)

public bool IsNightTime()

Returns

bool

IsSameDay(GameDateTime)

Returns true if the two GameDateTimes are on the same day (ignores time).

public bool IsSameDay(GameDateTime other)

Parameters

other GameDateTime

Returns

bool

IsSameTime(GameDateTime)

Returns true if the two GameDateTimes are at the same day and time.

public bool IsSameTime(GameDateTime other)

Parameters

other GameDateTime

Returns

bool

ToS1()

Converts this wrapper to the internal GameDateTime struct.

public GameDateTime ToS1()

Returns

GameDateTime

ToString()

String representation: "Day 3, 2:30 PM"

public override string ToString()

Returns

string

Operators

operator +(GameDateTime, GameDateTime)

public static GameDateTime operator +(GameDateTime a, GameDateTime b)

Parameters

a GameDateTime
b GameDateTime

Returns

GameDateTime

operator >(GameDateTime, GameDateTime)

public static bool operator >(GameDateTime a, GameDateTime b)

Parameters

a GameDateTime
b GameDateTime

Returns

bool

operator <(GameDateTime, GameDateTime)

public static bool operator <(GameDateTime a, GameDateTime b)

Parameters

a GameDateTime
b GameDateTime

Returns

bool

operator -(GameDateTime, GameDateTime)

public static GameDateTime operator -(GameDateTime a, GameDateTime b)

Parameters

a GameDateTime
b GameDateTime

Returns

GameDateTime