Elin Decompiled Documentation EA 23.201 Nightly
Loading...
Searching...
No Matches
ZoneEventManager Class Reference
Inheritance diagram for ZoneEventManager:
EClass

Public Member Functions

void OnLoad (Zone _zone)
 
void Add< T > (bool allowDuplicate=false)
 
void Add (ZoneEvent e, bool allowDuplicate=false)
 
void AddPreEnter (ZonePreEnterEvent e, bool executeIfActiveZone=true)
 
GetEvent< T > ()
 
void Remove< T > ()
 
void Remove (ZoneEvent e)
 
void Clear ()
 
void Tick (float delta)
 
void OnVisit ()
 
void OnLeaveZone ()
 
void OnCharaDie (Chara c)
 
void OnSimulateHour ()
 

Public Attributes

Zone zone
 
List< ZoneEventlist = new List<ZoneEvent>()
 
List< ZonePreEnterEventlistPreEnter = new List<ZonePreEnterEvent>()
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
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)
 
- Static Public Attributes inherited from EClass
static Core core
 
- 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]
 

Detailed Description

Definition at line 6 of file ZoneEventManager.cs.

Member Function Documentation

◆ Add()

void ZoneEventManager.Add ( ZoneEvent  e,
bool  allowDuplicate = false 
)
inline

Definition at line 31 of file ZoneEventManager.cs.

32 {
34 {
35 return;
36 }
37 if (!allowDuplicate)
38 {
39 foreach (ZoneEvent item in list)
40 {
41 if (e.GetType() == item.GetType())
42 {
43 return;
44 }
45 }
46 }
47 list.Add(e);
48 e.zone = zone;
49 e.Init();
50 Debug.Log("#game zone event " + e.GetType()?.ToString() + " added.");
51 }
bool skipEvent
Definition: CoreDebug.cs:162
Definition: EClass.cs:5
static CoreDebug debug
Definition: EClass.cs:48
List< ZoneEvent > list
virtual bool debugSkip
Definition: ZoneEvent.cs:31
void Init()
Definition: ZoneEvent.cs:64

References EClass.debug, Debug, ZoneEvent.debugSkip, ZoneEvent.Init(), item, list, CoreDebug.skipEvent, and zone.

Referenced by Add< T >(), QuestInstance.CreateInstanceZone(), SurvivalManager.OnMineWreck(), TraitPhone.OnSimulateHour(), QuestFiamaLock.OnStart(), CoreDebug.Test_Siege(), CoreDebug.Test_SiegeGuard(), and TraitCoreDefense.TrySetAct().

◆ Add< T >()

void ZoneEventManager.Add< T > ( bool  allowDuplicate = false)
inline
Type Constraints
T :ZoneEvent 

Definition at line 26 of file ZoneEventManager.cs.

26 : ZoneEvent
27 {
28 Add(Activator.CreateInstance<T>(), allowDuplicate);
29 }
void Add(ZoneEvent e, bool allowDuplicate=false)

References Add().

◆ AddPreEnter()

void ZoneEventManager.AddPreEnter ( ZonePreEnterEvent  e,
bool  executeIfActiveZone = true 
)
inline

Definition at line 53 of file ZoneEventManager.cs.

54 {
55 if (zone.IsActiveZone && executeIfActiveZone)
56 {
57 e.Execute();
58 }
59 else
60 {
61 listPreEnter.Add(e);
62 }
63 }
List< ZonePreEnterEvent > listPreEnter
virtual void Execute()
bool IsActiveZone
Definition: Zone.cs:490

References ZonePreEnterEvent.Execute(), Zone.IsActiveZone, listPreEnter, and zone.

Referenced by Player.EnterLocalZone(), TraitNewZone.MoveZone(), and DramaManager.ParseLine().

◆ Clear()

void ZoneEventManager.Clear ( )
inline

Definition at line 93 of file ZoneEventManager.cs.

94 {
95 list.Clear();
96 }

References list.

◆ GetEvent< T >()

T ZoneEventManager.GetEvent< T > ( )
inline
Type Constraints
T :ZoneEvent 

Definition at line 65 of file ZoneEventManager.cs.

65 : ZoneEvent
66 {
67 foreach (ZoneEvent item in list)
68 {
69 if (item is T)
70 {
71 return item as T;
72 }
73 }
74 return null;
75 }

References item, and list.

◆ OnCharaDie()

void ZoneEventManager.OnCharaDie ( Chara  c)
inline

Definition at line 122 of file ZoneEventManager.cs.

123 {
124 list.ForeachReverse(delegate(ZoneEvent e)
125 {
126 e.OnCharaDie(c);
127 });
128 }
virtual void OnCharaDie(Chara c)
Definition: ZoneEvent.cs:102

References list, and ZoneEvent.OnCharaDie().

Referenced by Chara.Die().

◆ OnLeaveZone()

void ZoneEventManager.OnLeaveZone ( )
inline

Definition at line 114 of file ZoneEventManager.cs.

115 {
116 foreach (ZoneEvent item in list)
117 {
118 item.OnLeaveZone();
119 }
120 }

References item, and list.

◆ OnLoad()

void ZoneEventManager.OnLoad ( Zone  _zone)
inline

Definition at line 16 of file ZoneEventManager.cs.

17 {
18 zone = _zone;
19 foreach (ZoneEvent item in list)
20 {
21 item.zone = zone;
22 item.OnLoad();
23 }
24 }
static Zone _zone
Definition: EClass.cs:20

References EClass._zone, item, list, and zone.

Referenced by Zone.OnLoad().

◆ OnSimulateHour()

void ZoneEventManager.OnSimulateHour ( )
inline

Definition at line 130 of file ZoneEventManager.cs.

131 {
132 if (list.Count == 0)
133 {
134 return;
135 }
136 foreach (ZoneEvent item in list.Copy())
137 {
138 item.OnSimulateHour();
139 }
140 }

References item, and list.

Referenced by Zone.OnSimulateHour().

◆ OnVisit()

void ZoneEventManager.OnVisit ( )
inline

Definition at line 106 of file ZoneEventManager.cs.

107 {
108 foreach (ZoneEvent item in list)
109 {
110 item.OnVisit();
111 }
112 }

References item, and list.

Referenced by Zone.OnVisit().

◆ Remove()

void ZoneEventManager.Remove ( ZoneEvent  e)
inline

Definition at line 88 of file ZoneEventManager.cs.

89 {
90 list.Remove(e);
91 }

References list.

Referenced by CoreDebug.Test_Siege(), and CoreDebug.Test_SiegeGuard().

◆ Remove< T >()

void ZoneEventManager.Remove< T > ( )
inline
Type Constraints
T :ZoneEvent 

Definition at line 77 of file ZoneEventManager.cs.

77 : ZoneEvent
78 {
79 for (int num = list.Count - 1; num >= 0; num--)
80 {
81 if (list[num] is T)
82 {
83 list[num].Kill();
84 }
85 }
86 }

References list.

◆ Tick()

void ZoneEventManager.Tick ( float  delta)
inline

Definition at line 98 of file ZoneEventManager.cs.

99 {
100 list.ForeachReverse(delegate(ZoneEvent e)
101 {
102 e.Tick(delta);
103 });
104 }
void Tick(float delta)
Definition: ZoneEvent.cs:48

References list, and ZoneEvent.Tick().

Referenced by GameUpdater.Update().

Member Data Documentation

◆ list

◆ listPreEnter

List<ZonePreEnterEvent> ZoneEventManager.listPreEnter = new List<ZonePreEnterEvent>()

Definition at line 14 of file ZoneEventManager.cs.

Referenced by AddPreEnter().

◆ zone

Zone ZoneEventManager.zone

Definition at line 8 of file ZoneEventManager.cs.

Referenced by Add(), AddPreEnter(), and OnLoad().


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