custom-chatbot / data /CommandSetup.cs
fastx's picture
Upload 84 files
ce81a16
raw
history blame
777 Bytes
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();
}
}
}