Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RealTimeTouristAI{TAI, TCitizen}"/> class.
 /// </summary>
 ///
 /// <param name="config">The configuration to run with.</param>
 /// <param name="connections">A <see cref="GameConnections{T}"/> instance that provides the game connection implementation.</param>
 /// <param name="touristAI">A connection to game's tourist AI.</param>
 /// <param name="eventManager">The custom event manager.</param>
 /// <param name="spareTimeBehavior">A behavior that provides simulation info for the citizens spare time.</param>
 ///
 /// <exception cref="ArgumentNullException">Thrown when any argument is null.</exception>
 public RealTimeTouristAI(
     RealTimeConfig config,
     GameConnections <TCitizen> connections,
     TouristAIConnection <TAI, TCitizen> touristAI,
     IRealTimeEventManager eventManager,
     ISpareTimeBehavior spareTimeBehavior)
     : base(config, connections, eventManager)
 {
     this.touristAI         = touristAI ?? throw new ArgumentNullException(nameof(touristAI));
     this.spareTimeBehavior = spareTimeBehavior ?? throw new ArgumentNullException(nameof(spareTimeBehavior));
 }
Beispiel #2
0
        /// <summary>Initializes a new instance of the <see cref="RealTimeResidentAI{TAI, TCitizen}"/> class.</summary>
        /// <exception cref="ArgumentNullException">Thrown when any argument is null.</exception>
        /// <param name="config">A <see cref="RealTimeConfig"/> instance containing the mod's configuration.</param>
        /// <param name="connections">A <see cref="GameConnections{T}"/> instance that provides the game connection implementation.</param>
        /// <param name="residentAI">A connection to the game's resident AI.</param>
        /// <param name="eventManager">An <see cref="IRealTimeEventManager"/> instance.</param>
        /// <param name="buildingAI">The custom building AI.</param>
        /// <param name="workBehavior">A behavior that provides simulation info for the citizens work time.</param>
        /// <param name="spareTimeBehavior">A behavior that provides simulation info for the citizens spare time.</param>
        /// <param name="travelBehavior">A behavior that provides simulation info for the citizens traveling.</param>
        public RealTimeResidentAI(
            RealTimeConfig config,
            GameConnections <TCitizen> connections,
            ResidentAIConnection <TAI, TCitizen> residentAI,
            IRealTimeEventManager eventManager,
            IRealTimeBuildingAI buildingAI,
            IWorkBehavior workBehavior,
            ISpareTimeBehavior spareTimeBehavior,
            ITravelBehavior travelBehavior)
            : base(config, connections, eventManager)
        {
            this.residentAI        = residentAI ?? throw new ArgumentNullException(nameof(residentAI));
            this.buildingAI        = buildingAI ?? throw new ArgumentNullException(nameof(buildingAI));
            this.workBehavior      = workBehavior ?? throw new ArgumentNullException(nameof(workBehavior));
            this.spareTimeBehavior = spareTimeBehavior ?? throw new ArgumentNullException(nameof(spareTimeBehavior));
            this.travelBehavior    = travelBehavior ?? throw new ArgumentNullException(nameof(travelBehavior));

            residentSchedules = new CitizenSchedule[CitizenMgr.GetMaxCitizensCount()];
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RealTimeHumanAIBase{TCitizen}"/> class.
        /// </summary>
        ///
        /// <exception cref="ArgumentNullException">Thrown when any argument is null.</exception>
        ///
        /// <param name="config">A configuration to use with this custom logic.</param>
        /// <param name="connections">An object providing the proxies that connect the method calls to the game methods.</param>
        /// <param name="eventManager">A reference to an <see cref="IRealTimeEventManager"/> instance.</param>
        protected RealTimeHumanAIBase(RealTimeConfig config, GameConnections <TCitizen> connections, IRealTimeEventManager eventManager)
        {
            Config   = config ?? throw new ArgumentNullException(nameof(config));
            EventMgr = eventManager ?? throw new ArgumentNullException(nameof(eventManager));

            if (connections == null)
            {
                throw new ArgumentNullException(nameof(connections));
            }

            CitizenMgr   = connections.CitizenManager;
            BuildingMgr  = connections.BuildingManager;
            TransferMgr  = connections.TransferManager;
            CitizenProxy = connections.CitizenConnection;
            TimeInfo     = connections.TimeInfo;
            Random       = connections.Random;
            WeatherInfo  = connections.WeatherInfo;

            CitizenInstancesMaxCount = CitizenMgr.GetMaxInstancesCount();
        }