Elin Decompiled Documentation EA 23.200 Stable
Loading...
Searching...
No Matches
DramaSequence Class Reference
Inheritance diagram for DramaSequence:
EClass

Public Types

enum  Template { Default }
 

Public Member Functions

void Clear ()
 
DramaActor GetActor (string id)
 
GetEvent< T > (string idStep)
 
DramaActor AddActor (string id, Person person)
 
void AddStep (string id)
 
DramaEvent AddEvent (DramaEvent e)
 
void PlayNext ()
 
void Play (string id)
 
void Play (int eventID=0)
 
void Exit ()
 
void OnUpdate ()
 

Public Attributes

string id
 
DramaManager manager
 
Dictionary< string, int > steps = new Dictionary<string, int>()
 
Dictionary< string, DramaActoractors = new Dictionary<string, DramaActor>()
 
List< DramaEventevents = new List<DramaEvent>()
 
bool isLoop
 
bool canCancel = true
 
bool isExited
 
bool fullPortrait
 
DramaEventTalk firstTalk
 
List< DramaEventtempEvents = new List<DramaEvent>()
 
string message = ""
 
string skipJump
 
string lastStep
 
string lastlastStep
 
DramaSetup setup
 

Properties

DialogDrama dialog [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]
 

Private Attributes

DramaEvent currentEvent
 
int currentEventID
 

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
 

Detailed Description

Definition at line 4 of file DramaSequence.cs.

Member Enumeration Documentation

◆ Template

Enumerator
Default 

Definition at line 6 of file DramaSequence.cs.

Member Function Documentation

◆ AddActor()

DramaActor DramaSequence.AddActor ( string  id,
Person  person 
)
inline

Definition at line 94 of file DramaSequence.cs.

95 {
96 if (actors.ContainsKey(id))
97 {
98 return actors[id];
99 }
101 dramaActor.Init(this, id, person);
102 actors.Add(id, dramaActor);
103 return dramaActor;
104 }
void Init(DramaSequence _sequence, string _id, Person _owner)
Definition: DramaActor.cs:19
Transform actorPos
Definition: DramaManager.cs:21
DramaActor moldActor
Definition: DramaManager.cs:25
Dictionary< string, DramaActor > actors
DramaManager manager
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References DramaManager.actorPos, actors, id, DramaActor.Init(), manager, DramaManager.moldActor, and Util.

Referenced by GetActor(), DramaManager.Load(), and DramaManager.ParseLine().

◆ AddEvent()

DramaEvent DramaSequence.AddEvent ( DramaEvent  e)
inline

Definition at line 116 of file DramaSequence.cs.

117 {
118 if (!e.step.IsEmpty())
119 {
120 steps.Add(e.step, events.Count);
121 }
122 e.sequence = this;
123 events.Add(e);
124 return e;
125 }
string step
Definition: DramaEvent.cs:9
List< DramaEvent > events
Dictionary< string, int > steps

References events, DramaEvent.step, and steps.

Referenced by DramaManager.AddEvent().

◆ AddStep()

void DramaSequence.AddStep ( string  id)
inline

Definition at line 106 of file DramaSequence.cs.

107 {
108 steps.Add(id, events.Count);
109 events.Add(new DramaEvent
110 {
111 sequence = this,
112 step = id
113 });
114 }

References events, and steps.

Referenced by DramaManager.ParseLine().

◆ Clear()

void DramaSequence.Clear ( )
inline

Definition at line 49 of file DramaSequence.cs.

50 {
51 steps.Clear();
52 actors.Clear();
53 events.Clear();
54 tempEvents.Clear();
55 }
List< DramaEvent > tempEvents

References actors, events, steps, and tempEvents.

Referenced by DramaManager.Load().

◆ Exit()

void DramaSequence.Exit ( )
inline

Definition at line 180 of file DramaSequence.cs.

181 {
182 isExited = true;
183 currentEvent = null;
184 manager.SetActive(enable: false);
185 }
DramaEvent currentEvent

References currentEvent, isExited, and manager.

Referenced by DramaManager.AddCustomEvents(), DramaEventExit.Play(), DramaEventTalk.Play(), and Play().

◆ GetActor()

DramaActor DramaSequence.GetActor ( string  id)
inline

Definition at line 57 of file DramaSequence.cs.

58 {
59 if (actors.ContainsKey(id))
60 {
61 return actors[id];
62 }
63 if (EClass.sources.persons.map.ContainsKey(id))
64 {
65 return AddActor(id, new Person(id));
66 }
68 {
70 if (chara != null)
71 {
72 return AddActor(id, new Person(chara));
73 }
74 }
75 if (actors.Count <= 0)
76 {
77 return GetActor("narrator");
78 }
79 return actors.FirstItem();
80 }
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:84
DramaActor AddActor(string id, Person person)
DramaActor GetActor(string id)
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Core core
Definition: EClass.cs:6
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
CardManager cards
Definition: Game.cs:155
Chara FindChara(string id)
Definition: Map.cs:2568
Definition: Person.cs:6
SourcePerson persons

References EClass._map, actors, AddActor(), Game.cards, EClass.core, CardManager.GlobalCharaList.Find(), Map.FindChara(), EClass.game, GetActor(), CardManager.globalCharas, id, Core.IsGameStarted, SourceManager.persons, and EClass.sources.

Referenced by DramaManager.AddEvent(), and GetActor().

◆ GetEvent< T >()

T DramaSequence.GetEvent< T > ( string  idStep)
inline
Type Constraints
T :DramaEvent 

Definition at line 82 of file DramaSequence.cs.

83 {
84 foreach (DramaEvent @event in events)
85 {
86 if (@event.step == idStep)
87 {
88 return @event as T;
89 }
90 }
91 return null;
92 }

References events, and DramaEvent.step.

◆ OnUpdate()

void DramaSequence.OnUpdate ( )
inline

Definition at line 187 of file DramaSequence.cs.

188 {
189 if (tempEvents.Count > 0)
190 {
191 if (tempEvents[0].Play() && tempEvents.Count > 0)
192 {
193 tempEvents.RemoveAt(0);
194 }
195 }
196 else
197 {
198 if (currentEvent == null)
199 {
200 return;
201 }
203 {
204 string text = currentEvent.idJump;
205 if (text == "*")
206 {
207 if (setup.step.IsEmpty())
208 {
209 PlayNext();
210 return;
211 }
212 text = setup.step;
213 }
214 Play(text);
215 }
216 else if (currentEvent.Play())
217 {
218 PlayNext();
219 }
220 }
221 }
string idJump
Definition: DramaEvent.cs:5
virtual bool Play()
Definition: DramaEvent.cs:23
DramaSetup setup
void Play(string id)
string step
Definition: DramaSetup.cs:7

References currentEvent, DramaEvent.idJump, DramaEvent.Play(), Play(), PlayNext(), setup, DramaSetup.step, and tempEvents.

Referenced by Play(), and DramaManager.Update().

◆ Play() [1/2]

void DramaSequence.Play ( int  eventID = 0)
inline

Definition at line 145 of file DramaSequence.cs.

146 {
147 if (isExited)
148 {
149 return;
150 }
151 if (eventID >= events.Count)
152 {
153 if (!isLoop)
154 {
155 Exit();
156 return;
157 }
158 eventID = 0;
159 }
160 currentEventID = eventID;
161 currentEvent = events[eventID];
163 string text = eventID + "/";
164 foreach (KeyValuePair<string, int> step in steps)
165 {
166 if (step.Value == eventID)
167 {
168 text += step.Key;
169 }
170 if (step.Value == eventID && !step.Key.StartsWith("flag"))
171 {
173 lastStep = step.Key;
174 break;
175 }
176 }
177 OnUpdate();
178 }
virtual void Reset()
Definition: DramaEvent.cs:28
string lastlastStep

References currentEvent, currentEventID, events, Exit(), isExited, isLoop, lastlastStep, lastStep, OnUpdate(), DramaEvent.Reset(), and steps.

◆ Play() [2/2]

void DramaSequence.Play ( string  id)
inline

Definition at line 132 of file DramaSequence.cs.

133 {
134 if (id == "last")
135 {
136 id = lastlastStep;
137 }
138 if (!id.IsEmpty() && !steps.ContainsKey(id))
139 {
140 Debug.Log(id);
141 }
142 Play((!string.IsNullOrEmpty(id)) ? steps[id] : 0);
143 }

References Debug, lastlastStep, Play(), and steps.

Referenced by OnUpdate(), DramaManager.ParseLine(), DramaEventMethod.Play(), DramaEventTalk.Play(), DramaManager.Play(), Play(), PlayNext(), and DramaCustomSequence.TempGoto().

◆ PlayNext()

void DramaSequence.PlayNext ( )
inline

Definition at line 127 of file DramaSequence.cs.

128 {
129 Play(currentEventID + 1);
130 }

References currentEventID, and Play().

Referenced by OnUpdate(), and DramaEventTalk.Play().

Member Data Documentation

◆ actors

Dictionary<string, DramaActor> DramaSequence.actors = new Dictionary<string, DramaActor>()

Definition at line 17 of file DramaSequence.cs.

Referenced by AddActor(), Clear(), and GetActor().

◆ canCancel

bool DramaSequence.canCancel = true

Definition at line 23 of file DramaSequence.cs.

◆ currentEvent

DramaEvent DramaSequence.currentEvent
private

Definition at line 33 of file DramaSequence.cs.

Referenced by Exit(), OnUpdate(), and Play().

◆ currentEventID

int DramaSequence.currentEventID
private

Definition at line 45 of file DramaSequence.cs.

Referenced by Play(), and PlayNext().

◆ events

List<DramaEvent> DramaSequence.events = new List<DramaEvent>()

Definition at line 19 of file DramaSequence.cs.

Referenced by AddEvent(), AddStep(), Clear(), GetEvent< T >(), DramaManager.ParseLine(), and Play().

◆ firstTalk

DramaEventTalk DramaSequence.firstTalk

Definition at line 29 of file DramaSequence.cs.

Referenced by DramaEventTalk.Play().

◆ fullPortrait

bool DramaSequence.fullPortrait

Definition at line 27 of file DramaSequence.cs.

Referenced by DramaActor.Talk().

◆ id

string DramaSequence.id

Definition at line 11 of file DramaSequence.cs.

Referenced by AddActor(), and GetActor().

◆ isExited

bool DramaSequence.isExited

Definition at line 25 of file DramaSequence.cs.

Referenced by Exit(), LayerDrama.LateUpdate(), and Play().

◆ isLoop

bool DramaSequence.isLoop

Definition at line 21 of file DramaSequence.cs.

Referenced by Play().

◆ lastlastStep

string DramaSequence.lastlastStep

Definition at line 41 of file DramaSequence.cs.

Referenced by Play().

◆ lastStep

string DramaSequence.lastStep

Definition at line 39 of file DramaSequence.cs.

Referenced by Play().

◆ manager

DramaManager DramaSequence.manager

◆ message

string DramaSequence.message = ""

Definition at line 35 of file DramaSequence.cs.

Referenced by DramaEventTalk.Play().

◆ setup

DramaSetup DramaSequence.setup

Definition at line 43 of file DramaSequence.cs.

Referenced by DramaManager.AddCustomEvents(), OnUpdate(), and DramaManager.ParseLine().

◆ skipJump

string DramaSequence.skipJump

Definition at line 37 of file DramaSequence.cs.

◆ steps

Dictionary<string, int> DramaSequence.steps = new Dictionary<string, int>()

◆ tempEvents

List<DramaEvent> DramaSequence.tempEvents = new List<DramaEvent>()

Property Documentation

◆ dialog

DialogDrama DramaSequence.dialog
get

Definition at line 47 of file DramaSequence.cs.

Referenced by DramaEventMethod.Play(), and DramaEventTalk.Play().


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