You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
	
	
		
			
				
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using CleverCrow.Fluid.BTs.Tasks; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace Game | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class AIObjectBase<T> where T : new() | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         protected enum ETaskStatus | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Success, | 
					
						
							|  |  |  |  |             Failure, | 
					
						
							|  |  |  |  |             Continue | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Selector(Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Selector("selector", action); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Selector(string name, Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.Selector(name); | 
					
						
							|  |  |  |  |             action(); | 
					
						
							|  |  |  |  |             _builder.End(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Sequence(Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Sequence("sequence", action); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Sequence(string name, Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.Sequence(name); | 
					
						
							|  |  |  |  |             action(); | 
					
						
							|  |  |  |  |             _builder.End(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Do(string name, Func<ETaskStatus> action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.Do(name, () => (TaskStatus)action()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Condition(string name, Func<bool> action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.Condition(name, action); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void ReturnSuccess(Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.ReturnSuccess(); | 
					
						
							|  |  |  |  |             action(); | 
					
						
							|  |  |  |  |             _builder.End(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void ReturnFailure(Action action) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             _builder.ReturnFailure(); | 
					
						
							|  |  |  |  |             action(); | 
					
						
							|  |  |  |  |             _builder.End(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |