Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spell-check #1672

Merged
merged 5 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions TLM/TLM/Custom/PathFinding/CustomPathFind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ ref candidateItem.LaneId.ToLane(),
string reachableBuf = string.Empty;
string unreachableBuf = string.Empty;

// TODO: optimizeme: Building a list of positions is faster than string concat
// TODO: optimize: Building a list of positions is faster than string concat
foreach (KeyValuePair<ushort, IList<ushort>> e in debugPositions_) {
string buf = $"{e.Key} -> {e.Value.CollectionToString()}\n";
if (e.Value.Count <= 0) {
Expand Down Expand Up @@ -1301,7 +1301,7 @@ ref nextPedZoneSegmentId.ToSegment(),
unitId,
item,
"ProcessItemMain: beautification -> ped: Exploring " +
$"pedestrian lane to beautficiation node\n\tnextNodeId={nextNodeId}");
$"pedestrian lane to beautification node\n\tnextNodeId={nextNodeId}");
}

// we are going from pedestrian lane to a beautification node
Expand Down Expand Up @@ -2889,7 +2889,7 @@ private bool ProcessItemCosts(
(NetInfo.LaneType.Pedestrian |
NetInfo.LaneType.PublicTransport)) ==
NetInfo.LaneType.Pedestrian) {
// account for public tranport transition costs on non-PT paths
// account for public transport transition costs on non-PT paths
float transportTransitionPenalty =
(2f * pfPublicTransportTransitionMaxPenalty) /
(0.5f * maxLength_);
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Custom/PathFinding/CustomPathManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void UpdateOldPathManagerValues(PathManager stockPathManager) {
BindingFlags.NonPublic | BindingFlags.Instance)
?? throw new Exception("f_pathFinds is null");

// both stcok and custom PathMangers use the same lock object
// both stock and custom PathMangers use the same lock object
lock (m_bufferLock) {
for (int i = 0; i < n; i++) {
Log._Debug($"PF {i}: {_replacementPathFinds[i].m_queuedPathFindCount} queued path-finds");
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/Lifecycle/SerializableDataExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private static void LoadDataState(out bool error) {
error = true;
}
} else {
Log.Info("Parking restrctions structure undefined!");
Log.Info("Parking restrictions structure undefined!");
}

// load vehicle restrictions (warning: has to be done before loading timed lights!)
Expand All @@ -266,7 +266,7 @@ private static void LoadDataState(out bool error) {
error = true;
}
} else {
Log.Info("Vehicle restrctions structure undefined!");
Log.Info("Vehicle restrictions structure undefined!");
}

if (_configuration.TimedLights != null) {
Expand Down Expand Up @@ -295,7 +295,7 @@ private static void LoadDataState(out bool error) {
Log.Info("Junction traffic lights data structure (new) undefined!");
}

// load lane arrrows (old method)
// load lane arrows (old method)
if (_configuration.LaneFlags != null) {
if (!LaneArrowManager.Instance.LoadData(_configuration.LaneFlags)) {
error = true;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Lifecycle/TMPELifecycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ internal void Unload() {
GlobalConfig.OnLevelUnloading();

if (PlayMode) {
// destroy immidately to prevent duplicates after hot-reload.
// destroy immediately to prevent duplicates after hot-reload.
var uiviewGO = UIView.GetAView().gameObject;
DestroyImmediate(uiviewGO.GetComponent<RoadSelectionPanels>());
DestroyImmediate(uiviewGO.GetComponent<RemoveVehicleButtonExtender>());
Expand Down
30 changes: 11 additions & 19 deletions TLM/TLM/Manager/Impl/AdvancedParkingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public bool EnterParkedCar(ushort instanceId,
instanceData.m_flags &= ~CitizenInstance.Flags.BoredOfWaiting;
instanceData.m_waitCounter = 0;

// unspawn citizen instance
// despawn citizen instance
instanceData.Unspawn(instanceId);

if (extendedLogParkingAi) {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ private static ExtSoftPathState OnCitizenPathFindSuccess_ToTarget(
if (logParkingAi) {
Log._Debug(
$"AdvancedParkingManager.OnCitizenPathFindSuccess({instanceId}): " +
$"Citizen instance {instanceId} is now travelling by foot to their final " +
$"Citizen instance {instanceId} is now traveling by foot to their final " +
$"target. CurrentDepartureMode={extInstance.pathMode}, " +
$"targetPos={instanceData.m_targetPos} " +
$"lastFramePos={instanceData.GetLastFramePosition()}");
Expand Down Expand Up @@ -1232,7 +1232,7 @@ private ExtSoftPathState
Log._Debug(
$"AdvancedParkingManager.OnCitizenPathFindSuccess({instanceId}): " +
$"Citizen instance {instanceId} has entered their car and is now " +
$"travelling by car (vehicleId={vehicleId}). " +
$"traveling by car (vehicleId={vehicleId}). " +
$"CurrentDepartureMode={extInstance.pathMode}, " +
$"targetPos={instanceData.m_targetPos} " +
$"lastFramePos={instanceData.GetLastFramePosition()}");
Expand Down Expand Up @@ -1268,7 +1268,7 @@ private ExtSoftPathState
extCitInstMan.Reset(ref extInstance);

if (usesPublicTransport) {
// decrease public tranport demand
// decrease public transport demand
if (instanceData.m_sourceBuilding != 0) {
extBuildingMan.RemovePublicTransportDemand(
ref extBuildingMan.ExtBuildings[instanceData.m_sourceBuilding],
Expand Down Expand Up @@ -1376,13 +1376,13 @@ private ExtSoftPathState

// if tourist (does not have home) and at outside connection, don't try to spawn parked vehicle
// cim might just exit the vehicle to despawn at outside connection
// or just spawned at the edge of the map - must walk to closest node to spawn the vehicle to enter city(resident/tourist) or go to different conneciton(dummy traffic)
// or just spawned at the edge of the map - must walk to closest node to spawn the vehicle to enter city(resident/tourist) or go to different connection(dummy traffic)
if (homeId == 0 && ExtCitizenInstanceManager.Instance.IsAtOutsideConnection(instanceId, ref instanceData, ref extInstance, currentPos)) {
Log._DebugIf(
logParkingAi,
() => $"AdvancedParkingManager.OnCitizenPathFindSuccess({instanceId}): " +
$">> Skipped spawning parked vehicle for citizen {instanceData.m_citizen} " +
$"(instance {instanceId}) is at/near outside conneciton, currentPos: {currentPos}");
$"(instance {instanceId}) is at/near outside connection, currentPos: {currentPos}");

extInstance.pathMode = ExtPathMode.RequiresWalkingPathToTarget;
return ExtSoftPathState.FailedSoft;
Expand Down Expand Up @@ -1487,7 +1487,7 @@ private ExtSoftPathState
"Switching path mode to walking.");

if (usesPublicTransport) {
// decrease public tranport demand
// decrease public transport demand
if (instanceData.m_sourceBuilding != 0) {
extBuildingMan.RemovePublicTransportDemand(
ref extBuildingMan.ExtBuildings[instanceData.m_sourceBuilding],
Expand Down Expand Up @@ -2281,7 +2281,7 @@ public bool FindParkingSpaceInVicinity(Vector3 targetPos,
logParkingAi,
() => "Found an (alternative) road-side parking position for " +
$"vehicle {vehicleId} @ segment {parkingSpaceSegmentId} after comparing " +
$"distance with a bulding parking position @ {parkingBuildingId}!");
$"distance with a building parking position @ {parkingBuildingId}!");

parkPos = roadParkPos;
parkRot = roadParkRot;
Expand Down Expand Up @@ -2749,7 +2749,7 @@ public bool FindParkingSpacePropAtBuilding(VehicleInfo vehicleInfo,
// check if building is accessible from the given segment
Log._DebugIf(
logParkingAi,
() => $"Calculating unspawn position of building {buildingId} for segment {segmentId}.");
() => $"Calculating despawn position of building {buildingId} for segment {segmentId}.");

building.Info.m_buildingAI.CalculateUnspawnPosition(
buildingId,
Expand All @@ -2772,24 +2772,16 @@ public bool FindParkingSpacePropAtBuilding(VehicleInfo vehicleInfo,
{
Log._DebugIf(
logParkingAi,
() => "Succeeded in finding unspawn position lane offset for building " +
() => "Succeeded in finding despawn position lane offset for building " +
$"{buildingId}, segment {segmentId}, unspawnPos={unspawnPos}! " +
$"lanePos={lanePos}, dist={(lanePos - unspawnPos).magnitude}, " +
$"laneId={laneId}, laneIndex={laneIndex}, laneOffset={laneOffset}");

// if (dist > 16f) {
// if (debug)
// Log._Debug(
// $"Distance between unspawn position and lane position is too big! {dist}
// unspawnPos={unspawnPos} lanePos={lanePos}");
// return false;
// }

parkOffset = laneOffset;
} else {
Log._DebugIf(
logParkingAi,
() => $"Could not find unspawn position lane offset for building {buildingId}, " +
() => $"Could not find despawn position lane offset for building {buildingId}, " +
$"segment {segmentId}, unspawnPos={unspawnPos}!");
}

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ bool citizenDebug
"their car before and is not at home. Forcing to walk to parked car.");
}
} else {
// citizen travelled by other means of transport
// citizen traveled by other means of transport
// -> check distance between home and parked car. if too far away:
// force to take the car back home
float distHomeToParked = (parkedVehicle.m_position - homeId.ToBuilding().m_position).magnitude;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/ExtSegmentEndManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void Recalculate(ref ExtSegmentEnd segEnd) {
}

/// <summary>
/// This recalcualtion must requires to be called after CalcualteSegment(). therefore it is not being called together
/// This recalculation must requires to be called after CalcualteSegment(). therefore it is not being called together
/// with other calculations.
/// </summary>
/// <param name="segmentId"></param>
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/ExtVehicleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ public void UpdatePosition(ref ExtVehicle extVehicle,
}

if (logVehicleLinking) {
Log._Debug($"ExtVehicleManager.UpdatePosition({extVehicle.vehicleId}) finshed: {extVehicle}");
Log._Debug($"ExtVehicleManager.UpdatePosition({extVehicle.vehicleId}) finished: {extVehicle}");
}
}

Expand Down
4 changes: 2 additions & 2 deletions TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected override void HandleValidSegment(ref ExtSegment seg) {
}

/// <summary>
/// called when deserailizing or when policy changes.
/// called when deserializing or when policy changes.
/// TODO [issue #1116]: publish segment changes? if so it should be done only when policy changes not when deserializing.
/// </summary>
public void UpdateAllDefaults() {
Expand Down Expand Up @@ -710,7 +710,7 @@ public bool GetDefaultPedestrianCrossingAllowed(ushort segmentId, bool startNode
if (sizeDiff == 0)
return true; //if same size then both will get crossings.

// at bridge/tunnel entracnes, pedestrian crossing is on ground road.
// at bridge/tunnel entrances, pedestrian crossing is on ground road.
bool isRoad1 = info1.m_netAI is RoadAI;
bool isRoad2 = info2.m_netAI is RoadAI;
if (isRoad1 && !isRoad2)
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/Manager/Impl/LaneArrowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class LaneArrowManager
NetInfo.LaneType.Vehicle | NetInfo.LaneType.TransportVehicle;

/// <summary>
/// vehcile types for all road vehicles
/// vehicle types for all road vehicles
/// </summary>
public const VehicleInfo.VehicleType VEHICLE_TYPES = VehicleInfo.VehicleType.Car;

Expand Down Expand Up @@ -67,7 +67,7 @@ public bool SetLaneArrows(uint laneId,
}

/// <summary>
/// Add arrows to the lane. This will not remove any prevously set flags and
/// Add arrows to the lane. This will not remove any previously set flags and
/// will remove and replace default arrows only where flag is set.
/// default arrows may change as user connects or remove more segments to the junction but
/// the user arrows stay the same no matter what.
Expand Down Expand Up @@ -202,7 +202,7 @@ private static void RecalculateFlags(uint laneId) {
ref NetSegment segment = ref segmentId.ToSegment();
NetAI ai = segment.Info.m_netAI;
#if DEBUGFLAGS
Log._Debug($"Flags.RecalculateFlags: Recalculateing lane arrows of segment {segmentId}.");
Log._Debug($"Flags.RecalculateFlags: Recalculating lane arrows of segment {segmentId}.");
#endif
ai.UpdateLanes(segmentId, ref segment, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static bool IsDirectionValid(ref NetLane lane, NetInfo.Lane laneInfo, ushort nod
}

private void AssertLane(uint laneId, bool startNode) {
Assert(laneId.ToLane().IsValidWithSegment(), $"IsValidWithSegment() faild for laneId:{laneId}");
Assert(laneId.ToLane().IsValidWithSegment(), $"IsValidWithSegment() failed for laneId:{laneId}");
var connections = GetLaneConnections(laneId, startNode);
if (connections != null && connections.Contains(laneId)) {
// dead end should only have one connection to itself.
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public bool SetParkingAllowed(ushort segmentId, NetInfo.Direction finalDir, bool
parkingAllowed[segmentId][dirIndex] = flag;

if (!flag || !parkingAllowed[segmentId][1 - dirIndex]) {
// force relocation of illegaly parked vehicles
// force relocation of illegally parked vehicles
Singleton<SimulationManager>.instance.AddAction(
() => segmentId.ToSegment().UpdateSegment(segmentId));
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/SpeedLimitManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private static float ToGameSpeedLimit(float customSpeedLimit) {
}

/// <summary>
/// Scans lanes which may have customisaable speed limit and returns the fastest <c>m_speedLimit</c> encountered.
/// Scans lanes which may have customizable speed limit and returns the fastest <c>m_speedLimit</c> encountered.
/// </summary>
/// <param name="info">The <see cref="NetInfo"/> to inspect.</param>
/// <returns>The vanilla speed limit, in game units.</returns>
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public void SimulationStep() {
failedNodeId = 0;
}
catch (Exception ex) {
Log.Error($"Error occured while simulating traffic light @ node {failedNodeId}: {ex}");
Log.Error($"Error occurred while simulating traffic light @ node {failedNodeId}: {ex}");

if (failedNodeId != 0) {
RemoveNodeFromSimulation(failedNodeId);
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/UtilityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void RemoveParkedVehicles() {
}
}
} catch (Exception ex) {
Log.Error($"Error occured while trying to remove parked vehicles: {ex}");
Log.Error($"Error occurred while trying to remove parked vehicles: {ex}");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/VehicleRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ internal void ClearCache() {
}

public void NotifyStartEndNode(ushort segmentId) {
// TODO this is hacky. Instead of notifying geometry observers we should add a seperate notification mechanic
// TODO this is hacky. Instead of notifying geometry observers we should add a separate notification mechanic
// notify observers of start node and end node (e.g. for separate traffic lights)
ref NetSegment netSegment = ref segmentId.ToSegment();

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Manager classes that allow for creating and controlling custom behavior.
- **TrafficPriorityManager**: Manages priority signs and implements priority rules at junctions with priority signs (entry point: **HasVehiclePriority**).
- **UtilityManager**: Offers auxiliary functions that must be executed within the simulation thread
- **VehicleBehaviorManager**: Implements vehicle behavior (mainly at junctions). Traffic light states and priority rule checking is delegated here.
- **VehicleRestrictionsManager**: Manages custom vehicle restrictions (custom bans for cars, cargo trucks, busses, etc.).
- **VehicleRestrictionsManager**: Manages custom vehicle restrictions (custom bans for cars, cargo trucks, buses, etc.).
- **VehicleStateManager**: Manages vehicle states (both positional and general vehicle states are stored).

Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static bool Prefix(ResidentAI __instance,
if (forceElectric && carInfo.m_class.m_subService != ItemClass.SubService.ResidentialLowEco) {
Log._DebugIf(logParkingAi,
() => $"CustomResidentAI.CustomGetVehicleInfo({instanceID}): " +
$"Force electric! Parked vehicle {parkedVehicleId} is not electric vehicle, wwap with electric one.");
$"Force electric! Parked vehicle {parkedVehicleId} is not electric vehicle, swap with electric one.");

if (AdvancedParkingManager.SwapParkedVehicleWithElectric(
logParkingAi: logParkingAi,
Expand Down
Loading