Skip to content
This repository was archived by the owner on Dec 20, 2022. It is now read-only.

Commit b2e81b0

Browse files
committed
Updated EgoSystem Start, Update & FixedUpdate API
1 parent ec296ce commit b2e81b0

File tree

12 files changed

+339
-46
lines changed

12 files changed

+339
-46
lines changed

System/EgoSystem1.cs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,34 @@ protected void RemoveBundle( EgoComponent egoComponent )
5454
_bundles.Remove( egoComponent );
5555
}
5656

57-
public virtual void Start() { }
57+
public virtual void Start()
58+
{
59+
foreach( var bundle in bundles )
60+
{
61+
Start( bundle.egoComponent, bundle.component1 );
62+
}
63+
}
64+
65+
public virtual void Update()
66+
{
67+
foreach( var bundle in bundles )
68+
{
69+
Update( bundle.egoComponent, bundle.component1 );
70+
}
71+
}
72+
73+
public virtual void FixedUpdate()
74+
{
75+
foreach( var bundle in bundles )
76+
{
77+
FixedUpdate( bundle.egoComponent, bundle.component1 );
78+
}
79+
}
80+
public virtual void Start( EgoComponent egoComponent, C1 component1 ) { }
5881

59-
public virtual void Update() { }
82+
public virtual void Update( EgoComponent egoComponent, C1 component1 ) { }
6083

61-
public virtual void FixedUpdate() { }
84+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1 ) { }
6285

6386
//
6487
// Event Handlers

System/EgoSystem10.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> : IEgoSystem
4+
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
where C3 : Component
@@ -269,11 +269,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
269269
_bundles.Remove( egoComponent );
270270
}
271271

272-
public virtual void Start() { }
272+
public virtual void Start()
273+
{
274+
foreach( var bundle in bundles )
275+
{
276+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
277+
}
278+
}
279+
280+
public virtual void Update()
281+
{
282+
foreach( var bundle in bundles )
283+
{
284+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
285+
}
286+
}
287+
288+
public virtual void FixedUpdate()
289+
{
290+
foreach( var bundle in bundles )
291+
{
292+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
293+
}
294+
}
295+
296+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10 ) { }
273297

274-
public virtual void Update() { }
298+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10 ) { }
275299

276-
public virtual void FixedUpdate() { }
300+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10 ) { }
277301

278302
//
279303
// Event Handlers

System/EgoSystem11.cs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11> : IEgoSystem
4+
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
where C3 : Component
@@ -302,11 +302,36 @@ protected void RemoveBundle( EgoComponent egoComponent )
302302
_bundles.Remove( egoComponent );
303303
}
304304

305-
public virtual void Start() { }
305+
public virtual void Start()
306+
{
307+
foreach( var bundle in bundles )
308+
{
309+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11 );
310+
}
311+
}
312+
313+
public virtual void Update()
314+
{
315+
foreach( var bundle in bundles )
316+
{
317+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11 );
318+
}
319+
}
320+
321+
public virtual void FixedUpdate()
322+
{
323+
foreach( var bundle in bundles )
324+
{
325+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11 );
326+
}
327+
}
328+
329+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11 ) { }
330+
331+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11 ) { }
306332

307-
public virtual void Update() { }
333+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11 ) { }
308334

309-
public virtual void FixedUpdate() { }
310335

311336
//
312337
// Event Handlers

System/EgoSystem12.cs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12> : IEgoSystem
4+
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
where C3 : Component
@@ -337,11 +337,36 @@ protected void RemoveBundle( EgoComponent egoComponent )
337337
_bundles.Remove( egoComponent );
338338
}
339339

340-
public virtual void Start() { }
340+
public virtual void Start()
341+
{
342+
foreach( var bundle in bundles )
343+
{
344+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11, bundle.component12 );
345+
}
346+
}
347+
348+
public virtual void Update()
349+
{
350+
foreach( var bundle in bundles )
351+
{
352+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11, bundle.component12 );
353+
}
354+
}
355+
356+
public virtual void FixedUpdate()
357+
{
358+
foreach( var bundle in bundles )
359+
{
360+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10, bundle.component11, bundle.component12 );
361+
}
362+
}
363+
364+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11, C12 component12 ) { }
365+
366+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11, C12 component12 ) { }
341367

342-
public virtual void Update() { }
368+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5, C6 component6, C7 component7, C8 component8, C9 component9, C10 component10, C11 component11, C12 component12 ) { }
343369

344-
public virtual void FixedUpdate() { }
345370

346371
//
347372
// Event Handlers

System/EgoSystem2.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2> : IEgoSystem
4+
public class EgoSystem<C1, C2> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
{
@@ -77,11 +77,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
7777
_bundles.Remove( egoComponent );
7878
}
7979

80-
public virtual void Start() { }
80+
public virtual void Start()
81+
{
82+
foreach( var bundle in bundles )
83+
{
84+
Start( bundle.egoComponent, bundle.component1, bundle.component2 );
85+
}
86+
}
87+
88+
public virtual void Update()
89+
{
90+
foreach( var bundle in bundles )
91+
{
92+
Update( bundle.egoComponent, bundle.component1, bundle.component2 );
93+
}
94+
}
95+
96+
public virtual void FixedUpdate()
97+
{
98+
foreach( var bundle in bundles )
99+
{
100+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2 );
101+
}
102+
}
103+
104+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2 ) { }
81105

82-
public virtual void Update() { }
106+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2 ) { }
83107

84-
public virtual void FixedUpdate() { }
108+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2 ) { }
85109

86110
//
87111
// Event Handlers

System/EgoSystem3.cs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
9494
_bundles.Remove( egoComponent );
9595
}
9696

97-
public virtual void Start() { }
97+
public virtual void Start()
98+
{
99+
foreach( var bundle in bundles )
100+
{
101+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
102+
}
103+
}
104+
105+
public virtual void Update()
106+
{
107+
foreach( var bundle in bundles )
108+
{
109+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
110+
}
111+
}
112+
113+
public virtual void FixedUpdate()
114+
{
115+
foreach( var bundle in bundles )
116+
{
117+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
118+
}
119+
}
120+
121+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }
98122

99-
public virtual void Update() { }
123+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }
100124

101-
public virtual void FixedUpdate() { }
125+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }
102126

103127
//
104128
// Event Handlers

System/EgoSystem4.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2, C3, C4> : IEgoSystem
4+
public class EgoSystem<C1, C2, C3, C4> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
where C3 : Component
@@ -113,11 +113,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
113113
_bundles.Remove( egoComponent );
114114
}
115115

116-
public virtual void Start() { }
116+
public virtual void Start()
117+
{
118+
foreach( var bundle in bundles )
119+
{
120+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
121+
}
122+
}
123+
124+
public virtual void Update()
125+
{
126+
foreach( var bundle in bundles )
127+
{
128+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
129+
}
130+
}
131+
132+
public virtual void FixedUpdate()
133+
{
134+
foreach( var bundle in bundles )
135+
{
136+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
137+
}
138+
}
139+
140+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }
117141

118-
public virtual void Update() { }
142+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }
119143

120-
public virtual void FixedUpdate() { }
144+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }
121145

122146
//
123147
// Event Handlers

System/EgoSystem5.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
public class EgoSystem<C1, C2, C3, C4, C5> : IEgoSystem
4+
public class EgoSystem<C1, C2, C3, C4, C5> : IEgoSystem
55
where C1 : Component
66
where C2 : Component
77
where C3 : Component
@@ -134,11 +134,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
134134
_bundles.Remove( egoComponent );
135135
}
136136

137-
public virtual void Start() { }
137+
public virtual void Start()
138+
{
139+
foreach( var bundle in bundles )
140+
{
141+
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
142+
}
143+
}
144+
145+
public virtual void Update()
146+
{
147+
foreach( var bundle in bundles )
148+
{
149+
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
150+
}
151+
}
152+
153+
public virtual void FixedUpdate()
154+
{
155+
foreach( var bundle in bundles )
156+
{
157+
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
158+
}
159+
}
160+
161+
public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5 ) { }
138162

139-
public virtual void Update() { }
163+
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5 ) { }
140164

141-
public virtual void FixedUpdate() { }
165+
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5 ) { }
142166

143167
//
144168
// Event Handlers

0 commit comments

Comments
 (0)