-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from post-kerbin-mining-corporation/dev
Prepare 1.12 updates
- Loading branch information
Showing
7 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+512 Bytes
(100%)
GameData/DynamicBatteryStorage/Plugins/DynamicBatteryStorage.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
Source/DynamicBatteryStorage/Handlers/Power/ScanSatPowerHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
|
||
namespace DynamicBatteryStorage | ||
{ | ||
public class SCANsatPowerHandler : ModuleDataHandler | ||
{ | ||
public SCANsatPowerHandler(HandlerModuleData moduleData) : base(moduleData) | ||
{ } | ||
protected override double GetValueEditor() | ||
{ | ||
for (int i = pm.resHandler.inputResources.Count - 1; i >= 0; i--) | ||
{ | ||
if (pm.resHandler.inputResources[i].name == "ElectricCharge") | ||
{ | ||
return -(float)pm.resHandler.inputResources[i].rate; | ||
|
||
|
||
} | ||
} | ||
|
||
return 0f; | ||
} | ||
protected override double GetValueFlight() | ||
{ | ||
bool results = false; | ||
bool.TryParse(pm.Fields.GetValue("scanning").ToString(), out results); | ||
|
||
if (results) | ||
{ | ||
for (int i = pm.resHandler.inputResources.Count - 1; i >= 0; i--) | ||
{ | ||
if (pm.resHandler.inputResources[i].name == "ElectricCharge") | ||
{ | ||
return -(float)pm.resHandler.inputResources[i].rate; | ||
} | ||
} | ||
} | ||
return 0f; | ||
|
||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters