C# implementation of a behavior tree