Elin Decompiled Documentation EA 23.102 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 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 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 30 of file ZoneEventManager.cs.

31 {
33 {
34 return;
35 }
36 if (!allowDuplicate)
37 {
38 foreach (ZoneEvent item in list)
39 {
40 if (e.GetType() == item.GetType())
41 {
42 return;
43 }
44 }
45 }
46 list.Add(e);
47 e.zone = zone;
48 e.Init();
49 Debug.Log("#game zone event " + e.GetType()?.ToString() + " added.");
50 }
bool skipEvent
Definition: CoreDebug.cs:161
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(), TraitPhone.OnSimulateHour(), QuestFiamaLock.OnStart(), CoreDebug.Test_Siege(), and CoreDebug.Test_SiegeGuard().

◆ Add< T >()

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

Definition at line 25 of file ZoneEventManager.cs.

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

References Add().

◆ AddPreEnter()

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

Definition at line 52 of file ZoneEventManager.cs.

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

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 92 of file ZoneEventManager.cs.

93 {
94 list.Clear();
95 }

References list.

◆ GetEvent< T >()

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

Definition at line 64 of file ZoneEventManager.cs.

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

References item, and list.

◆ OnLeaveZone()

void ZoneEventManager.OnLeaveZone ( )
inline

Definition at line 113 of file ZoneEventManager.cs.

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

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.OnLoad(zone);
22 }
23 }
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 121 of file ZoneEventManager.cs.

122 {
123 if (list.Count == 0)
124 {
125 return;
126 }
127 foreach (ZoneEvent item in list.Copy())
128 {
129 item.OnSimulateHour();
130 }
131 }

References item, and list.

Referenced by Zone.OnSimulateHour().

◆ OnVisit()

void ZoneEventManager.OnVisit ( )
inline

Definition at line 105 of file ZoneEventManager.cs.

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

References item, and list.

Referenced by Zone.OnVisit().

◆ Remove()

void ZoneEventManager.Remove ( ZoneEvent  e)
inline

Definition at line 87 of file ZoneEventManager.cs.

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

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 76 of file ZoneEventManager.cs.

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

References list.

◆ Tick()

void ZoneEventManager.Tick ( float  delta)
inline

Definition at line 97 of file ZoneEventManager.cs.

98 {
99 list.ForeachReverse(delegate(ZoneEvent e)
100 {
101 e.Tick(delta);
102 });
103 }
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: