I changed it so i can have the FSM and bot in one project.
Can you foresee any problems with doing this?
This is what i'm using.
Code:
public void LoadInternStates()
{
try
{
// Load the assembly, and get the types contained
// within it.
//removed some path validation
Assembly asm = Assembly.GetExecutingAssembly(); // this is only changed line
Type[] types = asm.GetTypes();
foreach (Type type in types)
{
// Here's some fairly simple stuff.
if (type.IsClass && type.IsSubclassOf(typeof(State)))
{
// Create the State using the Activator class.
var tempState = (State) Activator.CreateInstance(type);
// Make sure we're not using two of the same state.
// (That would be bad!)
if (!States.Contains(tempState))
{
States.Add(tempState);
}
}
}
}
Thanks