Пример #1
0
        // 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;
        }
Пример #2
0
        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);
        }