mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
53974485c9
* add stuff * extract patches * extract worldobjects (#241) * add spiral sync * cleanup * cleanup * fix * rename * add computers * remove qnet flagshelper * Update README.md * cleanup
45 lines
997 B
C#
45 lines
997 B
C#
using OWML.Utils;
|
|
using QSB.WorldSync;
|
|
using System.Collections.Generic;
|
|
|
|
namespace QSB.TranslationSync.WorldObjects
|
|
{
|
|
internal class QSBComputer : WorldObject<NomaiComputer>
|
|
{
|
|
public override void Init(NomaiComputer computer, int id)
|
|
{
|
|
ObjectId = id;
|
|
AttachedObject = computer;
|
|
}
|
|
|
|
public void HandleSetAsTranslated(int id)
|
|
{
|
|
if (AttachedObject.IsTranslated(id))
|
|
{
|
|
return;
|
|
}
|
|
AttachedObject.SetAsTranslated(id);
|
|
}
|
|
|
|
public IEnumerable<int> GetTranslatedIds()
|
|
{
|
|
var activeList = AttachedObject.GetValue<List<NomaiComputerRing>>("_activeRingList");
|
|
foreach (var item in activeList)
|
|
{
|
|
if (AttachedObject.IsTranslated(item.GetEntryID()))
|
|
{
|
|
yield return item.GetEntryID();
|
|
}
|
|
}
|
|
var inactiveList = AttachedObject.GetValue<List<NomaiComputerRing>>("_inactiveRingList");
|
|
foreach (var item in inactiveList)
|
|
{
|
|
if (AttachedObject.IsTranslated(item.GetEntryID()))
|
|
{
|
|
yield return item.GetEntryID();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|