Skip to content

Commit

Permalink
Fix invalid method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
dymanoid committed May 21, 2019
1 parent ddd8529 commit eb301be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/RealTime/CustomAI/RealTimeResidentAI.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private bool UpdateCitizenSchedule(ref CitizenSchedule schedule, uint citizenId,

private void ExecuteCitizenSchedule(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen, bool noReschedule)
{
if (ProcessCurrentState(ref schedule, citizenId, ref citizen)
if (ProcessCurrentState(ref schedule, instance, citizenId, ref citizen)
&& schedule.ScheduledState == ResidentState.Unknown
&& !noReschedule)
{
Expand Down Expand Up @@ -415,7 +415,7 @@ private void ExecuteCitizenSchedule(ref CitizenSchedule schedule, TAI instance,
}
}

private bool ProcessCurrentState(ref CitizenSchedule schedule, uint citizenId, ref TCitizen citizen)
private bool ProcessCurrentState(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen)
{
switch (schedule.CurrentState)
{
Expand All @@ -429,7 +429,7 @@ private bool ProcessCurrentState(ref CitizenSchedule schedule, uint citizenId, r
return ProcessCitizenRelaxing(ref schedule, citizenId, ref citizen);

case ResidentState.Visiting:
return ProcessCitizenVisit(ref schedule, citizenId, ref citizen);
return ProcessCitizenVisit(ref schedule, instance, citizenId, ref citizen);

case ResidentState.InShelter:
return ProcessCitizenInShelter(ref schedule, ref citizen);
Expand Down
4 changes: 2 additions & 2 deletions src/RealTime/CustomAI/RealTimeResidentAI.Visit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ private bool ProcessCitizenShopping(ref CitizenSchedule schedule, uint citizenId
return RescheduleVisit(ref schedule, citizenId, ref citizen, currentBuilding);
}

private bool ProcessCitizenVisit(ref CitizenSchedule schedule, uint citizenId, ref TCitizen citizen)
private bool ProcessCitizenVisit(ref CitizenSchedule schedule, TAI instance, uint citizenId, ref TCitizen citizen)
{
var currentBuilding = CitizenProxy.GetVisitBuilding(ref citizen);
var currentBuildingService = BuildingMgr.GetBuildingService(currentBuilding);
if (currentBuildingService == ItemClass.Service.Education)
{
residentAI.AttemptAutodidact(ref citizen, currentBuildingService);
residentAI.AttemptAutodidact(instance, ref citizen, currentBuildingService);
}

return RescheduleVisit(ref schedule, citizenId, ref citizen, currentBuilding);
Expand Down
3 changes: 2 additions & 1 deletion src/RealTime/GameConnection/ResidentAIConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ public ResidentAIConnection(
/// Represents the method that corresponds to the AI's original <c>AttemptAutodidact</c> method
/// that updates the citizen's education level after visiting a library.
/// </summary>
/// <param name="instance">The AI instance the method is called on.</param>
/// <param name="citizen">The citizen object to process.</param>
/// <param name="visitedBuildingType">The type of the building the citizen leaves.</param>
public delegate void AttemptAutodidactDelegate(ref TCitizen citizen, ItemClass.Service visitedBuildingType);
public delegate void AttemptAutodidactDelegate(TAI instance, ref TCitizen citizen, ItemClass.Service visitedBuildingType);

/// <summary>Gets a method that calls a <see cref="FindHospitalDelegate"/>.</summary>
public FindHospitalDelegate FindHospital { get; }
Expand Down

0 comments on commit eb301be

Please sign in to comment.