mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
Fix spacing
This commit is contained in:
parent
4e8f9be510
commit
accd958dc1
2
.editorconfig
Normal file
2
.editorconfig
Normal file
@ -0,0 +1,2 @@
|
||||
[*.cs]
|
||||
indent_style = tab
|
||||
@ -29,19 +29,19 @@ public class ItemManager : WorldObjectManager
|
||||
QSBWorldSync.Init<QSBSimpleLanternItem, SimpleLanternItem>();
|
||||
QSBWorldSync.Init<QSBSlideReelItem, SlideReelItem>();
|
||||
QSBWorldSync.Init<QSBWarpCoreItem, WarpCoreItem>();
|
||||
// dream lantern and vision torch are set up in their own managers
|
||||
// dream lantern and vision torch are set up in their own managers
|
||||
|
||||
// Use the basic QSBItem class for any items that do not require custom code through a derived class (mod compatibility)
|
||||
// QSB addons can still define their own QSBItem derived classes and they will just get skipped here
|
||||
var handledItemTypes = GetHandledItemTypes();
|
||||
DebugLog.DebugWrite($"Handled OWItem types (the rest will get generic QSBItem support) are: {string.Join(", ", handledItemTypes)}");
|
||||
var otherItemlistToInitFrom = QSBWorldSync.GetUnityObjects<OWItem>()
|
||||
.Where(x => !handledItemTypes.Contains(x.GetType()))
|
||||
.SortDeterministic();
|
||||
QSBWorldSync.Init<QSBItem<OWItem>, OWItem>(otherItemlistToInitFrom);
|
||||
// Use the basic QSBItem class for any items that do not require custom code through a derived class (mod compatibility)
|
||||
// QSB addons can still define their own QSBItem derived classes and they will just get skipped here
|
||||
var handledItemTypes = GetHandledItemTypes();
|
||||
DebugLog.DebugWrite($"Handled OWItem types (the rest will get generic QSBItem support) are: {string.Join(", ", handledItemTypes)}");
|
||||
var otherItemlistToInitFrom = QSBWorldSync.GetUnityObjects<OWItem>()
|
||||
.Where(x => !handledItemTypes.Contains(x.GetType()))
|
||||
.SortDeterministic();
|
||||
QSBWorldSync.Init<QSBItem<OWItem>, OWItem>(otherItemlistToInitFrom);
|
||||
|
||||
// Sockets
|
||||
QSBWorldSync.Init<QSBItemSocket, OWItemSocket>();
|
||||
// Sockets
|
||||
QSBWorldSync.Init<QSBItemSocket, OWItemSocket>();
|
||||
|
||||
// other drop targets that don't already have world objects
|
||||
var listToInitFrom = QSBWorldSync.GetUnityObjects<MonoBehaviour>()
|
||||
@ -50,24 +50,24 @@ public class ItemManager : WorldObjectManager
|
||||
QSBWorldSync.Init<QSBOtherDropTarget, MonoBehaviour>(listToInitFrom);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all types that extend QSBItem and returns the list of OWItem types that are already handled by dedicated classes
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static IEnumerable<Type> GetHandledItemTypes()
|
||||
{
|
||||
var assemblies = QSBCore.Addons.Values
|
||||
.Select(x => x.GetType().Assembly)
|
||||
.Append(typeof(QSBCore).Assembly);
|
||||
/// <summary>
|
||||
/// Gets all types that extend QSBItem and returns the list of OWItem types that are already handled by dedicated classes
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static IEnumerable<Type> GetHandledItemTypes()
|
||||
{
|
||||
var assemblies = QSBCore.Addons.Values
|
||||
.Select(x => x.GetType().Assembly)
|
||||
.Append(typeof(QSBCore).Assembly);
|
||||
|
||||
if (QSBCore.QSBNHAssembly != null)
|
||||
{
|
||||
assemblies = assemblies.Append(QSBCore.QSBNHAssembly);
|
||||
}
|
||||
if (QSBCore.QSBNHAssembly != null)
|
||||
{
|
||||
assemblies = assemblies.Append(QSBCore.QSBNHAssembly);
|
||||
}
|
||||
|
||||
return assemblies.SelectMany(x => x.GetTypes())
|
||||
.Where(x => !x.IsInterface && !x.IsAbstract && x.BaseType != null && x.BaseType.IsGenericType && x.BaseType.GetGenericTypeDefinition() == typeof(QSBItem<>))
|
||||
.Select(x => x.BaseType.GetGenericArguments()[0])
|
||||
.OrderBy(x => x.FullName);
|
||||
}
|
||||
return assemblies.SelectMany(x => x.GetTypes())
|
||||
.Where(x => !x.IsInterface && !x.IsAbstract && x.BaseType != null && x.BaseType.IsGenericType && x.BaseType.GetGenericTypeDefinition() == typeof(QSBItem<>))
|
||||
.Select(x => x.BaseType.GetGenericArguments()[0])
|
||||
.OrderBy(x => x.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user