Spaces:
Runtime error
Runtime error
using Photon.Deterministic; | |
using System; | |
using System.Collections.Generic; | |
namespace Quantum | |
{ | |
public static class CommandSetup | |
{ | |
public static DeterministicCommand[] CreateCommands(RuntimeConfig gameConfig, SimulationConfig simulationConfig) | |
{ | |
Type baseType = typeof(DeterministicCommand); | |
Type[] allTypes = typeof(CommandSetup).Assembly.GetTypes(); | |
List<DeterministicCommand> commands = new List<DeterministicCommand>(16); | |
foreach (Type type in allTypes) | |
{ | |
if (type.IsSubclassOf(baseType) == true && type.IsAbstract == false) | |
{ | |
DeterministicCommand command = Activator.CreateInstance(type) as DeterministicCommand; | |
if (command != null) | |
{ | |
commands.Add(command); | |
} | |
} | |
} | |
return commands.ToArray(); | |
} | |
} | |
} | |