Elin Decompiled Documentation EA 23.102 Nightly
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 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 86 of file DramaSequence.cs.

87 {
88 if (actors.ContainsKey(id))
89 {
90 return actors[id];
91 }
93 dramaActor.Init(this, id, person);
94 actors.Add(id, dramaActor);
95 return dramaActor;
96 }
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 108 of file DramaSequence.cs.

109 {
110 if (!e.step.IsEmpty())
111 {
112 steps.Add(e.step, events.Count);
113 }
114 e.sequence = this;
115 events.Add(e);
116 return e;
117 }
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 98 of file DramaSequence.cs.

99 {
100 steps.Add(id, events.Count);
101 events.Add(new DramaEvent
102 {
103 sequence = this,
104 step = id
105 });
106 }

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 172 of file DramaSequence.cs.

173 {
174 isExited = true;
175 currentEvent = null;
176 manager.SetActive(enable: false);
177 }
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 }
67 if (actors.Count <= 0)
68 {
69 return GetActor("narrator");
70 }
71 return actors.FirstItem();
72 }
DramaActor AddActor(string id, Person person)
DramaActor GetActor(string id)
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
Definition: Person.cs:6
SourcePerson persons

References actors, AddActor(), GetActor(), id, 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 74 of file DramaSequence.cs.

75 {
76 foreach (DramaEvent @event in events)
77 {
78 if (@event.step == idStep)
79 {
80 return @event as T;
81 }
82 }
83 return null;
84 }

References events, and DramaEvent.step.

◆ OnUpdate()

void DramaSequence.OnUpdate ( )
inline

Definition at line 179 of file DramaSequence.cs.

180 {
181 if (tempEvents.Count > 0)
182 {
183 if (tempEvents[0].Play() && tempEvents.Count > 0)
184 {
185 tempEvents.RemoveAt(0);
186 }
187 }
188 else
189 {
190 if (currentEvent == null)
191 {
192 return;
193 }
195 {
196 string text = currentEvent.idJump;
197 if (text == "*")
198 {
199 if (setup.step.IsEmpty())
200 {
201 PlayNext();
202 return;
203 }
204 text = setup.step;
205 }
206 Play(text);
207 }
208 else if (currentEvent.Play())
209 {
210 PlayNext();
211 }
212 }
213 }
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 137 of file DramaSequence.cs.

138 {
139 if (isExited)
140 {
141 return;
142 }
143 if (eventID >= events.Count)
144 {
145 if (!isLoop)
146 {
147 Exit();
148 return;
149 }
150 eventID = 0;
151 }
152 currentEventID = eventID;
153 currentEvent = events[eventID];
155 string text = eventID + "/";
156 foreach (KeyValuePair<string, int> step in steps)
157 {
158 if (step.Value == eventID)
159 {
160 text += step.Key;
161 }
162 if (step.Value == eventID && !step.Key.StartsWith("flag"))
163 {
165 lastStep = step.Key;
166 break;
167 }
168 }
169 OnUpdate();
170 }
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 124 of file DramaSequence.cs.

125 {
126 if (id == "last")
127 {
128 id = lastlastStep;
129 }
130 if (!id.IsEmpty() && !steps.ContainsKey(id))
131 {
132 Debug.Log(id);
133 }
134 Play((!string.IsNullOrEmpty(id)) ? steps[id] : 0);
135 }

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 119 of file DramaSequence.cs.

120 {
121 Play(currentEventID + 1);
122 }

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: