mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 00:39:53 +00:00
cleanup
This commit is contained in:
parent
2deb2b80db
commit
a4a79544e3
@ -1,6 +1,5 @@
|
||||
using QSB.WorldSync;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.ElevatorSync
|
||||
@ -19,10 +18,7 @@ namespace QSB.ElevatorSync
|
||||
|
||||
public void OnDestroy() => QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
||||
|
||||
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
||||
{
|
||||
QSBWorldSync.Init<QSBElevator, Elevator>(ref _elevators);
|
||||
}
|
||||
private void OnSceneLoaded(OWScene scene, bool isInUniverse) => QSBWorldSync.Init<QSBElevator, Elevator>(ref _elevators);
|
||||
|
||||
public int GetId(Elevator elevator) => _elevators.IndexOf(elevator);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace QSB.GeyserSync
|
||||
QSBPatchManager.OnPatchType -= OnPatchType;
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
||||
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
||||
=> QSBWorldSync.Init<QSBGeyser, GeyserController>();
|
||||
|
||||
public void OnPatchType(QSBPatchTypes type)
|
||||
|
@ -1,7 +1,6 @@
|
||||
using QSB.Events;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.GeyserSync
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using QSB.WorldSync;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.QuantumSync
|
||||
{
|
||||
|
@ -1,7 +1,5 @@
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.QuantumSync
|
||||
|
@ -3,7 +3,6 @@ using QSB.OrbSync;
|
||||
using QSB.TransformSync;
|
||||
using QSB.Utility;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@ -32,15 +31,15 @@ namespace QSB.WorldSync
|
||||
|
||||
public static IEnumerable<T> GetWorldObjects<T>() => WorldObjects.OfType<T>();
|
||||
|
||||
public static T GetWorldObject<T, U>(int id) where T : WorldObject<U> where U : UnityEngine.Object
|
||||
public static T GetWorldObject<T, U>(int id) where T : WorldObject<U> where U : UnityEngine.Object
|
||||
=> GetWorldObjects<T>().FirstOrDefault(x => x.ObjectId == id);
|
||||
|
||||
public static void RemoveWorldObjects<T, U>() where T : WorldObject<U> where U : UnityEngine.Object
|
||||
public static void RemoveWorldObjects<T, U>() where T : WorldObject<U> where U : UnityEngine.Object
|
||||
=> WorldObjects.RemoveAll(x => x.GetType() == typeof(T));
|
||||
|
||||
public static void Init<QSBType, BaseType>(ref List<BaseType> list)
|
||||
where QSBType : WorldObject<BaseType>
|
||||
where BaseType : UnityEngine.Object
|
||||
where BaseType : UnityEngine.Object
|
||||
=> list = Init<QSBType, BaseType>();
|
||||
|
||||
public static List<BaseType> Init<QSBType, BaseType>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user