public void SetGoal(UnitGoal goal) { if (behaviourGenerators.TryGetValue(goal.GetType(), out var generator)) { currentBehaviour = generator.Invoke(goal, this); } else { currentBehaviour = null; } rethinkTimer.Reset(); }
// Methods. public string ComposeDescription(UnitGoal goal) => descriptionExtractor.Invoke(goal);