mirror of
https://github.com/riperiperi/FreeSO
synced 2026-08-13 20:26:13 -04:00
23 lines
644 B
C#
23 lines
644 B
C#
using System.Collections.Generic;
|
|
|
|
namespace FSO.SimAntics.Model
|
|
{
|
|
public class VMTuningCache
|
|
{
|
|
public Dictionary<int, float> MotiveOverfill = new Dictionary<int, float>();
|
|
|
|
public void UpdateTuning(VM vm)
|
|
{
|
|
if (vm.TS1) return;
|
|
var table = vm.Tuning?.GetTable("overfill", vm.TSOState.PropertyCategory);
|
|
if (table != null) MotiveOverfill = table;
|
|
}
|
|
|
|
public short GetLimit(VMMotive motive)
|
|
{
|
|
float result;
|
|
if (MotiveOverfill.TryGetValue((int)motive, out result)) return (short)result;
|
|
return 100;
|
|
}
|
|
}
|
|
}
|