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<QSBSimpleLanternItem, SimpleLanternItem>();
|
||||||
QSBWorldSync.Init<QSBSlideReelItem, SlideReelItem>();
|
QSBWorldSync.Init<QSBSlideReelItem, SlideReelItem>();
|
||||||
QSBWorldSync.Init<QSBWarpCoreItem, WarpCoreItem>();
|
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)
|
// 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
|
// QSB addons can still define their own QSBItem derived classes and they will just get skipped here
|
||||||
var handledItemTypes = GetHandledItemTypes();
|
var handledItemTypes = GetHandledItemTypes();
|
||||||
DebugLog.DebugWrite($"Handled OWItem types (the rest will get generic QSBItem support) are: {string.Join(", ", handledItemTypes)}");
|
DebugLog.DebugWrite($"Handled OWItem types (the rest will get generic QSBItem support) are: {string.Join(", ", handledItemTypes)}");
|
||||||
var otherItemlistToInitFrom = QSBWorldSync.GetUnityObjects<OWItem>()
|
var otherItemlistToInitFrom = QSBWorldSync.GetUnityObjects<OWItem>()
|
||||||
.Where(x => !handledItemTypes.Contains(x.GetType()))
|
.Where(x => !handledItemTypes.Contains(x.GetType()))
|
||||||
.SortDeterministic();
|
.SortDeterministic();
|
||||||
QSBWorldSync.Init<QSBItem<OWItem>, OWItem>(otherItemlistToInitFrom);
|
QSBWorldSync.Init<QSBItem<OWItem>, OWItem>(otherItemlistToInitFrom);
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
QSBWorldSync.Init<QSBItemSocket, OWItemSocket>();
|
QSBWorldSync.Init<QSBItemSocket, OWItemSocket>();
|
||||||
|
|
||||||
// other drop targets that don't already have world objects
|
// other drop targets that don't already have world objects
|
||||||
var listToInitFrom = QSBWorldSync.GetUnityObjects<MonoBehaviour>()
|
var listToInitFrom = QSBWorldSync.GetUnityObjects<MonoBehaviour>()
|
||||||
@ -50,24 +50,24 @@ public class ItemManager : WorldObjectManager
|
|||||||
QSBWorldSync.Init<QSBOtherDropTarget, MonoBehaviour>(listToInitFrom);
|
QSBWorldSync.Init<QSBOtherDropTarget, MonoBehaviour>(listToInitFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all types that extend QSBItem and returns the list of OWItem types that are already handled by dedicated classes
|
/// Gets all types that extend QSBItem and returns the list of OWItem types that are already handled by dedicated classes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static IEnumerable<Type> GetHandledItemTypes()
|
private static IEnumerable<Type> GetHandledItemTypes()
|
||||||
{
|
{
|
||||||
var assemblies = QSBCore.Addons.Values
|
var assemblies = QSBCore.Addons.Values
|
||||||
.Select(x => x.GetType().Assembly)
|
.Select(x => x.GetType().Assembly)
|
||||||
.Append(typeof(QSBCore).Assembly);
|
.Append(typeof(QSBCore).Assembly);
|
||||||
|
|
||||||
if (QSBCore.QSBNHAssembly != null)
|
if (QSBCore.QSBNHAssembly != null)
|
||||||
{
|
{
|
||||||
assemblies = assemblies.Append(QSBCore.QSBNHAssembly);
|
assemblies = assemblies.Append(QSBCore.QSBNHAssembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
return assemblies.SelectMany(x => x.GetTypes())
|
return assemblies.SelectMany(x => x.GetTypes())
|
||||||
.Where(x => !x.IsInterface && !x.IsAbstract && x.BaseType != null && x.BaseType.IsGenericType && x.BaseType.GetGenericTypeDefinition() == typeof(QSBItem<>))
|
.Where(x => !x.IsInterface && !x.IsAbstract && x.BaseType != null && x.BaseType.IsGenericType && x.BaseType.GetGenericTypeDefinition() == typeof(QSBItem<>))
|
||||||
.Select(x => x.BaseType.GetGenericArguments()[0])
|
.Select(x => x.BaseType.GetGenericArguments()[0])
|
||||||
.OrderBy(x => x.FullName);
|
.OrderBy(x => x.FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user