// Constructors. public IntelligenceModule() { // Set fields. behaviourGenerators = new Dictionary <Type, BehaviourGenerator>() { [typeof(RelocationGoal)] = (goal, ownerPointer) => new RelocationBehaviour(goal as RelocationGoal, ownerPointer), [typeof(OffensiveGoal)] = (goal, ownerPointer) => new OffensiveBehaviour(goal as OffensiveGoal, ownerPointer) }; rethinkTimer = new TimeAccumulator(1); currentBehaviour = null; }
public IntelligenceModule(IntelligenceModule other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } // Set fields. behaviourGenerators = new Dictionary <Type, BehaviourGenerator>(other.behaviourGenerators); rethinkTimer = new TimeAccumulator(other.rethinkTimer); SetGoal(other.CurrentGoal); }