22 lines
480 B
C#
22 lines
480 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace Questionable.GameStructs;
|
|
|
|
[StructLayout(LayoutKind.Explicit, Size = 1280)]
|
|
internal struct AgentSatisfactionSupply2
|
|
{
|
|
[FieldOffset(112)]
|
|
public ushort CurrentSatisfaction;
|
|
|
|
[FieldOffset(114)]
|
|
public ushort MaxSatisfaction;
|
|
|
|
public int CalculateTurnInsToNextRank(int maxTurnIns)
|
|
{
|
|
if (MaxSatisfaction == 0)
|
|
{
|
|
return maxTurnIns;
|
|
}
|
|
return maxTurnIns * (MaxSatisfaction - CurrentSatisfaction) / MaxSatisfaction;
|
|
}
|
|
}
|