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

Commit

Permalink
Updated EgoSystem Start, Update & FixedUpdate API
Browse files Browse the repository at this point in the history
  • Loading branch information
andoowhy committed Apr 26, 2016
1 parent ec296ce commit b2e81b0
Show file tree
Hide file tree
Showing 12 changed files with 339 additions and 46 deletions.
29 changes: 26 additions & 3 deletions System/EgoSystem1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,34 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1 );
}
}
public virtual void Start( EgoComponent egoComponent, C1 component1 ) { }

public virtual void Update() { }
public virtual void Update( EgoComponent egoComponent, C1 component1 ) { }

public virtual void FixedUpdate() { }
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1 ) { }

//
// Event Handlers
Expand Down
32 changes: 28 additions & 4 deletions System/EgoSystem10.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> : IEgoSystem
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> : IEgoSystem
where C1 : Component
where C2 : Component
where C3 : Component
Expand Down Expand Up @@ -269,11 +269,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5, bundle.component6, bundle.component7, bundle.component8, bundle.component9, bundle.component10 );
}
}

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 ) { }

public virtual void Update() { }
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 ) { }

public virtual void FixedUpdate() { }
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 ) { }

//
// Event Handlers
Expand Down
33 changes: 29 additions & 4 deletions System/EgoSystem11.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11> : IEgoSystem
public class EgoSystem<C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11> : IEgoSystem
where C1 : Component
where C2 : Component
where C3 : Component
Expand Down Expand Up @@ -302,11 +302,36 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
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 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
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 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
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 );
}
}

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 ) { }

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 ) { }

public virtual void Update() { }
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 ) { }

public virtual void FixedUpdate() { }

//
// Event Handlers
Expand Down
33 changes: 29 additions & 4 deletions System/EgoSystem12.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

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

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
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 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
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 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
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 );
}
}

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 ) { }

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 ) { }

public virtual void Update() { }
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 ) { }

public virtual void FixedUpdate() { }

//
// Event Handlers
Expand Down
32 changes: 28 additions & 4 deletions System/EgoSystem2.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

public class EgoSystem<C1, C2> : IEgoSystem
public class EgoSystem<C1, C2> : IEgoSystem
where C1 : Component
where C2 : Component
{
Expand Down Expand Up @@ -77,11 +77,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1, bundle.component2 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1, bundle.component2 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2 );
}
}

public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2 ) { }

public virtual void Update() { }
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2 ) { }

public virtual void FixedUpdate() { }
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2 ) { }

//
// Event Handlers
Expand Down
30 changes: 27 additions & 3 deletions System/EgoSystem3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3 );
}
}

public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }

public virtual void Update() { }
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }

public virtual void FixedUpdate() { }
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3 ) { }

//
// Event Handlers
Expand Down
32 changes: 28 additions & 4 deletions System/EgoSystem4.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

public class EgoSystem<C1, C2, C3, C4> : IEgoSystem
public class EgoSystem<C1, C2, C3, C4> : IEgoSystem
where C1 : Component
where C2 : Component
where C3 : Component
Expand Down Expand Up @@ -113,11 +113,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4 );
}
}

public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }

public virtual void Update() { }
public virtual void Update( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }

public virtual void FixedUpdate() { }
public virtual void FixedUpdate( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4 ) { }

//
// Event Handlers
Expand Down
32 changes: 28 additions & 4 deletions System/EgoSystem5.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

public class EgoSystem<C1, C2, C3, C4, C5> : IEgoSystem
public class EgoSystem<C1, C2, C3, C4, C5> : IEgoSystem
where C1 : Component
where C2 : Component
where C3 : Component
Expand Down Expand Up @@ -134,11 +134,35 @@ protected void RemoveBundle( EgoComponent egoComponent )
_bundles.Remove( egoComponent );
}

public virtual void Start() { }
public virtual void Start()
{
foreach( var bundle in bundles )
{
Start( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
}
}

public virtual void Update()
{
foreach( var bundle in bundles )
{
Update( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
}
}

public virtual void FixedUpdate()
{
foreach( var bundle in bundles )
{
FixedUpdate( bundle.egoComponent, bundle.component1, bundle.component2, bundle.component3, bundle.component4, bundle.component5 );
}
}

public virtual void Start( EgoComponent egoComponent, C1 component1, C2 component2, C3 component3, C4 component4, C5 component5 ) { }

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

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

//
// Event Handlers
Expand Down
Loading

0 comments on commit b2e81b0

Please sign in to comment.