Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
VirtualDate Class Reference
Inheritance diagram for VirtualDate:
Date EClass

Public Member Functions

 VirtualDate (int elapsedHours=0)
 
BranchMap GetBranchMap ()
 
void BuildSunMap ()
 
void SimulateHour ()
 
void SimulateDay ()
 
void SimulateMonth ()
 
void SimulateYear ()
 
- Public Member Functions inherited from Date
Date Copy ()
 
override string ToString ()
 
void AddHour (int a)
 
void AddDay (int a)
 
void AddMonth (int a)
 
string GetText (TextFormat format)
 
int GetRawReal (int offsetHours=0)
 
int GetRaw (int offsetHours=0)
 
int GetRawDay ()
 
bool IsExpired (int time)
 
int GetRemainingHours (int rawDeadLine)
 
int GetRemainingSecs (int rawDeadLine)
 
int GetElapsedMins (int rawDate)
 
int GetElapsedHour (int rawDate)
 

Public Attributes

bool IsRealTime
 
HashSet< int > sunMap
 
BranchMap branchMap
 
- Public Attributes inherited from Date
int[] raw = new int[6]
 

Static Public Attributes

static Date current
 
- Static Public Attributes inherited from Date
const int ShippingHour = 5
 
const int HourToken = 60
 
const int DayToken = 1440
 
const int MonthToken = 43200
 
const int YearToken = 518400
 
const int HourTokenReal = 60
 
const int DayTokenReal = 1440
 
const int MonthTokenReal = 46080
 
const int YearTokenReal = 552960
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

static bool IsActive [get]
 
- Properties inherited from Date
int year [get, set]
 
int month [get, set]
 
int day [get, set]
 
int hour [get, set]
 
int min [get, set]
 
int sec [get, set]
 
bool IsDay [get]
 
bool IsNight [get]
 
PeriodOfDay periodOfDay [get]
 
string NameMonth [get]
 
string NameMonthShort [get]
 
string NameTime [get]
 
bool IsSpring [get]
 
bool IsSummer [get]
 
bool IsAutumn [get]
 
bool IsWinter [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Public Types inherited from Date
enum  TextFormat {
  Default , Log , Widget , Schedule ,
  Travel , YearMonthDay , LogPlusYear
}
 
- Static Public Member Functions inherited from Date
static string GetText (int raw, TextFormat format)
 
static string GetText (int hour)
 
static string GetText2 (int hour)
 
static string SecToDate (int sec)
 
static string MinToDayAndHour (int min)
 
static int[] GetDateArray (int raw)
 
static Date ToDate (int raw)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Detailed Description

Definition at line 3 of file VirtualDate.cs.

Constructor & Destructor Documentation

◆ VirtualDate()

VirtualDate.VirtualDate ( int  elapsedHours = 0)
inline

Definition at line 15 of file VirtualDate.cs.

16 {
17 for (int i = 0; i < raw.Length; i++)
18 {
19 raw[i] = EClass.world.date.raw[i];
20 }
21 base.min = 0;
22 while (elapsedHours > 0)
23 {
24 base.hour--;
25 if (base.hour < 0)
26 {
27 base.hour = 23;
28 base.day--;
29 if (base.day <= 0)
30 {
31 base.day = 30;
32 base.month--;
33 if (base.month <= 0)
34 {
35 base.month = 12;
36 base.year--;
37 }
38 }
39 }
40 elapsedHours--;
41 }
42 }
int[] raw
Definition: Date.cs:19
Definition: EClass.cs:5
static World world
Definition: EClass.cs:40
GameDate date
Definition: World.cs:6

References World.date, Date.raw, and EClass.world.

Member Function Documentation

◆ BuildSunMap()

void VirtualDate.BuildSunMap ( )
inline

Definition at line 54 of file VirtualDate.cs.

55 {
56 sunMap = new HashSet<int>();
57 foreach (Card sun in EClass._map.props.installed.traits.suns)
58 {
59 foreach (Point item in sun.trait.ListPoints(null, onlyPassable: false))
60 {
61 sunMap.Add(item.index);
62 }
63 }
64 }
Definition: Card.cs:11
Trait trait
Definition: Card.cs:49
static Map _map
Definition: EClass.cs:18
PropsManager props
Definition: Map.cs:91
Definition: Point.cs:9
PropsInstalled installed
Definition: PropsManager.cs:8
TraitManager traits
Definition: Props.cs:18
TraitMap suns
Definition: TraitManager.cs:14
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true)
Definition: Trait.cs:707
HashSet< int > sunMap
Definition: VirtualDate.cs:9

References EClass._map, PropsManager.installed, item, Trait.ListPoints(), Map.props, sunMap, TraitManager.suns, Card.trait, and Props.traits.

Referenced by GrowSystem.CanGrow(), and Zone.GrowPlants().

◆ GetBranchMap()

BranchMap VirtualDate.GetBranchMap ( )
inline

Definition at line 44 of file VirtualDate.cs.

45 {
46 if (branchMap == null)
47 {
48 branchMap = new BranchMap();
50 }
51 return branchMap;
52 }
void Refresh()
Definition: BranchMap.cs:7
BranchMap branchMap
Definition: VirtualDate.cs:11

References branchMap, and BranchMap.Refresh().

Referenced by FactionBranch.OnSimulateDay().

◆ SimulateDay()

void VirtualDate.SimulateDay ( )
inline

Definition at line 77 of file VirtualDate.cs.

78 {
79 base.day++;
80 if (base.day > 30)
81 {
82 base.day = 1;
84 }
86 }
static Zone _zone
Definition: EClass.cs:20
void SimulateMonth()
Definition: VirtualDate.cs:88
void OnSimulateDay(VirtualDate date)
Definition: Zone.cs:3095

References EClass._zone, Zone.OnSimulateDay(), and SimulateMonth().

Referenced by SimulateHour().

◆ SimulateHour()

void VirtualDate.SimulateHour ( )
inline

Definition at line 66 of file VirtualDate.cs.

67 {
68 base.hour++;
69 if (base.hour >= 24)
70 {
71 base.hour = 0;
73 }
75 }
void SimulateDay()
Definition: VirtualDate.cs:77
void OnSimulateHour(VirtualDate date)
Definition: Zone.cs:3040

References EClass._zone, Zone.OnSimulateHour(), and SimulateDay().

Referenced by GameDate.AdvanceHour(), and Zone.Simulate().

◆ SimulateMonth()

void VirtualDate.SimulateMonth ( )
inline

Definition at line 88 of file VirtualDate.cs.

89 {
90 base.month++;
91 if (base.month > 12)
92 {
93 base.month = 1;
95 }
97 }
void SimulateYear()
Definition: VirtualDate.cs:99
void OnSimulateMonth(VirtualDate date)
Definition: Zone.cs:3103

References EClass._zone, Zone.OnSimulateMonth(), and SimulateYear().

Referenced by SimulateDay().

◆ SimulateYear()

void VirtualDate.SimulateYear ( )
inline

Definition at line 99 of file VirtualDate.cs.

100 {
101 base.year++;
102 }

Referenced by SimulateMonth().

Member Data Documentation

◆ branchMap

BranchMap VirtualDate.branchMap

Definition at line 11 of file VirtualDate.cs.

Referenced by GetBranchMap().

◆ current

Date VirtualDate.current
static

Definition at line 5 of file VirtualDate.cs.

◆ IsRealTime

◆ sunMap

HashSet<int> VirtualDate.sunMap

Definition at line 9 of file VirtualDate.cs.

Referenced by BuildSunMap(), GrowSystem.CanGrow(), and Zone.GrowPlants().

Property Documentation

◆ IsActive

bool VirtualDate.IsActive
staticget

The documentation for this class was generated from the following file: