Skip to content

Commit

Permalink
Merge pull request #16 from gotmachine/patch-1
Browse files Browse the repository at this point in the history
Remove useless `IConfigNode` and `[Persistent]` implementations to fix conflict with KSPCommunityFixes
  • Loading branch information
linuxgurugamer authored Mar 26, 2023
2 parents 748f7d2 + cb2f4b0 commit 363476d
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions StationScience/StnSciScenario.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
This file is part of Station Science.
Station Science is free software: you can redistribute it and/or modify
Expand All @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License

namespace StationScience
{
public class StnSciContractReward : IConfigNode
public class StnSciContractReward
{
[Persistent] public float y_intercept;
[Persistent] public float slope;
Expand Down Expand Up @@ -56,17 +56,9 @@ public float calcFailure(float value, bool first_time = false)
{
return calcReward(value, first_time) * failure_multiplier;
}

public void Load(ConfigNode node)
{
}

public void Save(ConfigNode node)
{
}
}

public class CNMap<TValue> : Dictionary<string, TValue>, IConfigNode where TValue : IConvertible
public class CNMap<TValue> : Dictionary<string, TValue> where TValue : IConvertible
{
public void Load(ConfigNode node)
{
Expand All @@ -84,11 +76,6 @@ public void Load(ConfigNode node)
}
}
}

public void Save(ConfigNode node)
{
StnSciScenario.LogError("CNMap.Save called; not implemented");
}
}

public class CNMapSet<TValue> : Dictionary<string, HashSet<TValue> > where TValue : IConvertible
Expand Down Expand Up @@ -122,14 +109,9 @@ public void Load(ConfigNode node)
}
}
}

public void Save(ConfigNode node)
{
StnSciScenario.LogError("CNMapList.Save called; not implemented");
}
}

public class StnSciSettings : IConfigNode
public class StnSciSettings
{
[Persistent] public int maxContracts = 4;
[Persistent] public float progressionFactor = 0.5f;
Expand All @@ -143,15 +125,15 @@ public class StnSciSettings : IConfigNode
[Persistent] public StnSciContractReward contractReputation = new StnSciContractReward(10, 1, failure_multiplier: 1.5f);
[Persistent] public StnSciContractReward contractDeadline = new StnSciContractReward(2, 0.1f, first_time_multiplier: 2);

[Persistent] public CNMap<double> experimentChallenge = new CNMap<double>() {
public CNMap<double> experimentChallenge = new CNMap<double>() {
{ "StnSciExperiment1", 1 },
{ "StnSciExperiment2", 2 },
{ "StnSciExperiment3", 2.5 },
{ "StnSciExperiment4", 3 },
{ "StnSciExperiment5", 2.5 },
{ "StnSciExperiment6", 3.5 },
};
[Persistent] public CNMap<double> planetChallenge = new CNMap<double>() {
public CNMap<double> planetChallenge = new CNMap<double>() {
{ "Kerbin", 1 },
{ "Mun", 3 },
{ "Minmus", 3.25 },
Expand All @@ -168,7 +150,6 @@ public class StnSciSettings : IConfigNode
{ "Bop", 11 },
{ "Eeloo", 13 },
};
[Persistent]
public CNMapSet<string> experimentPrereqs = new CNMapSet<string>() {
{ "StnSciExperiment1", CNMapSet<string>.parse("StnSciExperiment1,StnSciLab") },
{ "StnSciExperiment2", CNMapSet<string>.parse("StnSciExperiment2,StnSciLab,StnSciCyclo") },
Expand Down

0 comments on commit 363476d

Please sign in to comment.