1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-10 06:43:27 +08:00

WIP for logistic_hub

This commit is contained in:
2024-12-02 21:55:35 +08:00
parent be9de43492
commit 6934607fca
14 changed files with 927 additions and 557 deletions

View File

@@ -0,0 +1,33 @@
using System.Linq;
namespace LogisticHub.Module;
using UXAssist.Common;
public static class AuxData
{
public static (long, bool)[] Fuels;
public static void Init()
{
GameLogic.OnDataLoaded += () =>
{
var maxId = LDB.items.dataArray.Select(data => data.ID).Prepend(0).Max();
Fuels = new (long, bool)[maxId + 1];
foreach (var data in LDB.items.dataArray)
Fuels[data.ID] = (data.HeatValue, data.Productive);
};
}
public static int AlignUpToPowerOf2(int n)
{
if (n < 16) return 16;
n--;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return n + 1;
}
}