Skip to content

Commit

Permalink
Renamed ComponentType to ComponentDefType.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Mar 9, 2019
1 parent da4e0ec commit e09845b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/Components/AutoLinked.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Link
{
public ChassisLocations Location;
public string ComponentDefId;
public ComponentType? ComponentType = null;
public ComponentType? ComponentDefType = null;
}

[CustomComponent("Linked")]
Expand All @@ -32,7 +32,7 @@ public void RemoveLinked(IMechLabDraggableItem item, MechLabPanel mechLab)
foreach (var r_link in Links)
{
Control.LogDebug(DType.ComponentInstall, $"{r_link.ComponentDefId} from {r_link.Location}");
DefaultHelper.RemoveMechLab(r_link.ComponentDefId, r_link.ComponentType ?? Def.ComponentType, helper, r_link.Location);
DefaultHelper.RemoveMechLab(r_link.ComponentDefId, r_link.ComponentDefType ?? Def.ComponentType, helper, r_link.Location);
}
}

Expand All @@ -58,14 +58,14 @@ public void OnInstalled(WorkOrderEntry_InstallComponent order, SimGameState stat
foreach (var link in Links)
{
Control.LogDebug(DType.ComponentInstall, $"-- removing {link.ComponentDefId} from {link.Location}");
DefaultHelper.RemoveInventory(link.ComponentDefId, mech, link.Location, link.ComponentType ?? Def.ComponentType);
DefaultHelper.RemoveInventory(link.ComponentDefId, mech, link.Location, link.ComponentDefType ?? Def.ComponentType);
}

if (order.DesiredLocation != ChassisLocations.None)
foreach (var link in Links)
{
Control.LogDebug(DType.ComponentInstall, $"-- adding {link.ComponentDefId} to {link.Location}");
DefaultHelper.AddInventory(link.ComponentDefId, mech, link.Location, link.ComponentType ?? Def.ComponentType, state);
DefaultHelper.AddInventory(link.ComponentDefId, mech, link.Location, link.ComponentDefType ?? Def.ComponentType, state);
}

}
Expand All @@ -80,7 +80,7 @@ public IEnumerable<IChange> ValidateDropOnAdd(MechLabItemSlotElement item, Locat
foreach (var link in Links)
{
Control.LogDebug(DType.ComponentInstall, $"---- {link.ComponentDefId} to {link.Location}");
var slot = DefaultHelper.CreateSlot(link.ComponentDefId, link.ComponentType ?? Def.ComponentType, mechlab.MechLab);
var slot = DefaultHelper.CreateSlot(link.ComponentDefId, link.ComponentDefType ?? Def.ComponentType, mechlab.MechLab);

if (slot != null)
{
Expand Down

0 comments on commit e09845b

Please sign in to comment.