Skip to content

Commit

Permalink
Now MemoryPool.Spawn methods are virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
KurbanismailovZaur authored and Mathijs-Bakker committed Aug 19, 2024
1 parent 76068b0 commit acfb232
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TValue IFactory<TValue>.Create()
public class MemoryPool<TParam1, TValue>
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TValue>, IFactory<TParam1, TValue>
{
public TValue Spawn(TParam1 param)
public virtual TValue Spawn(TParam1 param)
{
var item = GetInternal();

Expand Down Expand Up @@ -72,7 +72,7 @@ TValue IFactory<TParam1, TValue>.Create(TParam1 p1)
public class MemoryPool<TParam1, TParam2, TValue>
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TValue>, IFactory<TParam1, TParam2, TValue>
{
public TValue Spawn(TParam1 param1, TParam2 param2)
public virtual TValue Spawn(TParam1 param1, TParam2 param2)
{
var item = GetInternal();

Expand Down Expand Up @@ -107,7 +107,7 @@ TValue IFactory<TParam1, TParam2, TValue>.Create(TParam1 p1, TParam2 p2)
public class MemoryPool<TParam1, TParam2, TParam3, TValue>
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TValue>, IFactory<TParam1, TParam2, TParam3, TValue>
{
public TValue Spawn(TParam1 param1, TParam2 param2, TParam3 param3)
public virtual TValue Spawn(TParam1 param1, TParam2 param2, TParam3 param3)
{
var item = GetInternal();

Expand Down Expand Up @@ -141,7 +141,7 @@ TValue IFactory<TParam1, TParam2, TParam3, TValue>.Create(TParam1 p1, TParam2 p2
public class MemoryPool<TParam1, TParam2, TParam3, TParam4, TValue>
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TParam4, TValue>, IFactory<TParam1, TParam2, TParam3, TParam4, TValue>
{
public TValue Spawn(TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4)
public virtual TValue Spawn(TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4)
{
var item = GetInternal();

Expand Down Expand Up @@ -175,7 +175,7 @@ TValue IFactory<TParam1, TParam2, TParam3, TParam4, TValue>.Create(TParam1 p1, T
public class MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TValue>
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TValue>, IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TValue>
{
public TValue Spawn(
public virtual TValue Spawn(
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5)
{
var item = GetInternal();
Expand Down Expand Up @@ -210,7 +210,7 @@ public class MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TV
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TValue>,
IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TValue>
{
public TValue Spawn(
public virtual TValue Spawn(
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5, TParam6 param6)
{
var item = GetInternal();
Expand Down Expand Up @@ -246,7 +246,7 @@ public class MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TP
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TValue>,
IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TValue>
{
public TValue Spawn(
public virtual TValue Spawn(
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5, TParam6 param6, TParam7 param7)
{
var item = GetInternal();
Expand Down Expand Up @@ -282,7 +282,7 @@ public class MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TP
: MemoryPoolBase<TValue>, IMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TValue>,
IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TValue>
{
public TValue Spawn(
public virtual TValue Spawn(
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5, TParam6 param6, TParam7 param7, TParam8 param8)
{
var item = GetInternal();
Expand Down
8 changes: 8 additions & 0 deletions UnityProject/Assets/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions UnityProject/Assets/Scripts/Test.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{
private void Start()
{

}
}
11 changes: 11 additions & 0 deletions UnityProject/Assets/Scripts/Test.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit acfb232

Please sign in to comment.