Skip to content

Commit b9a147f

Browse files
committed
Formatting
1 parent ba49440 commit b9a147f

File tree

3 files changed

+68
-17
lines changed

3 files changed

+68
-17
lines changed

src/microbe_stage/OrganelleDefinition.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ public float Progress(WorldAndPlayerDataSource worldAndPlayerData)
795795
{
796796
if (UnlockConditions == null)
797797
return 0;
798+
798799
return UnlockConditions.Select(entry => entry.Progress(worldAndPlayerData)).Max();
799800
}
800801

src/microbe_stage/organelle_unlocks/StatisticBasedUnlockCondition.cs

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ public class EngulfedMicrobesAbove : StatisticBasedUnlockCondition
3333
[JsonProperty]
3434
public int Required { get; set; }
3535

36-
public override bool Satisfied(IUnlockStateDataSource data) => Engulfed(data) >= Required;
36+
public override bool Satisfied(IUnlockStateDataSource data)
37+
{
38+
return Engulfed(data) >= Required;
39+
}
40+
3741
public override float Progress(IUnlockStateDataSource data)
38-
=> Math.Clamp((float)(Engulfed(data) ?? 0) / Required, 0, 1);
42+
{
43+
return Math.Clamp((float)(Engulfed(data) ?? 0) / Required, 0, 1);
44+
}
3945

4046
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
4147
{
@@ -61,9 +67,15 @@ public class DigestedMicrobesAbove : StatisticBasedUnlockCondition
6167
[JsonProperty]
6268
public int Required { get; set; }
6369

64-
public override bool Satisfied(IUnlockStateDataSource data) => Digested(data) >= Required;
70+
public override bool Satisfied(IUnlockStateDataSource data)
71+
{
72+
return Digested(data) >= Required;
73+
}
74+
6575
public override float Progress(IUnlockStateDataSource data)
66-
=> Math.Clamp((float)(Digested(data) ?? 0) / Required, 0, 1);
76+
{
77+
return Math.Clamp((float)(Digested(data) ?? 0) / Required, 0, 1);
78+
}
6779

6880
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
6981
{
@@ -92,9 +104,15 @@ public class PlayerDeathsAbove : StatisticBasedUnlockCondition
92104
[JsonProperty]
93105
public int Required { get; set; }
94106

95-
public override bool Satisfied(IUnlockStateDataSource data) => PlayerDeaths(data) >= Required;
107+
public override bool Satisfied(IUnlockStateDataSource data)
108+
{
109+
return PlayerDeaths(data) >= Required;
110+
}
111+
96112
public override float Progress(IUnlockStateDataSource data)
97-
=> Math.Clamp((float)(PlayerDeaths(data) ?? 0) / Required, 0, 1);
113+
{
114+
return Math.Clamp((float)(PlayerDeaths(data) ?? 0) / Required, 0, 1);
115+
}
98116

99117
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
100118
{
@@ -141,7 +159,10 @@ public override bool Satisfied(IUnlockStateDataSource data)
141159
return count >= 1;
142160
}
143161

144-
public override float Progress(IUnlockStateDataSource data) => Satisfied(data) ? 1 : 0;
162+
public override float Progress(IUnlockStateDataSource data)
163+
{
164+
return Satisfied(data) ? 1 : 0;
165+
}
145166

146167
public override void Check(string name)
147168
{
@@ -199,10 +220,15 @@ public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStat
199220
}
200221
}
201222

202-
public override bool Satisfied(IUnlockStateDataSource data1) => CalculateCount(data1) >= Generations;
223+
public override bool Satisfied(IUnlockStateDataSource data1)
224+
{
225+
return CalculateCount(data1) >= Generations;
226+
}
203227

204228
public override float Progress(IUnlockStateDataSource data1)
205-
=> Math.Clamp((float)(CalculateCount(data1) ?? 0) / Generations, 0, 1);
229+
{
230+
return Math.Clamp((float)(CalculateCount(data1) ?? 0) / Generations, 0, 1);
231+
}
206232

207233
public override void Check(string name)
208234
{
@@ -269,9 +295,15 @@ public class DamageFromSource : StatisticBasedUnlockCondition
269295
[JsonProperty("Amount")]
270296
public float RequiredAmount { get; set; }
271297

272-
public override bool Satisfied(IUnlockStateDataSource data) => Damage(data) >= RequiredAmount;
298+
public override bool Satisfied(IUnlockStateDataSource data)
299+
{
300+
return Damage(data) >= RequiredAmount;
301+
}
302+
273303
public override float Progress(IUnlockStateDataSource data)
274-
=> Math.Clamp((Damage(data) ?? 0) / RequiredAmount, 0, 1);
304+
{
305+
return Math.Clamp((Damage(data) ?? 0) / RequiredAmount, 0, 1);
306+
}
275307

276308
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
277309
{

src/microbe_stage/organelle_unlocks/WorldBasedUnlockCondition.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ public class AtpProductionAbove : WorldBasedUnlockCondition
3333
[JsonProperty]
3434
public float Atp;
3535

36-
public override bool Satisfied(IUnlockStateDataSource data) => AtpProduction(data) >= Atp;
36+
public override bool Satisfied(IUnlockStateDataSource data)
37+
{
38+
return AtpProduction(data) >= Atp;
39+
}
3740

38-
public override float Progress(IUnlockStateDataSource data) => Math.Clamp(AtpProduction(data) ?? 0 / Atp, 0, 1);
41+
public override float Progress(IUnlockStateDataSource data)
42+
{
43+
return Math.Clamp(AtpProduction(data) ?? 0 / Atp, 0, 1);
44+
}
3945

4046
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
4147
{
@@ -59,9 +65,15 @@ public class ExcessAtpAbove : WorldBasedUnlockCondition
5965
[JsonProperty]
6066
public float Atp;
6167

62-
public override bool Satisfied(IUnlockStateDataSource data) => FinalBalance(data) >= Atp;
68+
public override bool Satisfied(IUnlockStateDataSource data)
69+
{
70+
return FinalBalance(data) >= Atp;
71+
}
6372

64-
public override float Progress(IUnlockStateDataSource data) => Math.Clamp(FinalBalance(data) ?? 0 / Atp, 0, 1);
73+
public override float Progress(IUnlockStateDataSource data)
74+
{
75+
return Math.Clamp(FinalBalance(data) ?? 0 / Atp, 0, 1);
76+
}
6577

6678
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
6779
{
@@ -85,7 +97,10 @@ public class SpeedBelow : WorldBasedUnlockCondition
8597
[JsonProperty]
8698
public float Threshold;
8799

88-
public override bool Satisfied(IUnlockStateDataSource data) => GetPlayerSpeed(data) < Threshold;
100+
public override bool Satisfied(IUnlockStateDataSource data)
101+
{
102+
return GetPlayerSpeed(data) < Threshold;
103+
}
89104

90105
public override float Progress(IUnlockStateDataSource data)
91106
{
@@ -145,7 +160,10 @@ public override bool Satisfied(IUnlockStateDataSource data)
145160
return minSatisfied && maxSatisfied;
146161
}
147162

148-
public override float Progress(IUnlockStateDataSource data) => Satisfied(data) ? 1 : 0;
163+
public override float Progress(IUnlockStateDataSource data)
164+
{
165+
return Satisfied(data) ? 1 : 0;
166+
}
149167

150168
public override void GenerateTooltip(LocalizedStringBuilder builder, IUnlockStateDataSource data)
151169
{

0 commit comments

Comments
 (0)