diff --git a/EasyCommands.Tests/ScriptTests/FunctionalTests/BlockHandlers/BatteryBlockTests.cs b/EasyCommands.Tests/ScriptTests/FunctionalTests/BlockHandlers/BatteryBlockTests.cs index ca7b643..098a361 100644 --- a/EasyCommands.Tests/ScriptTests/FunctionalTests/BlockHandlers/BatteryBlockTests.cs +++ b/EasyCommands.Tests/ScriptTests/FunctionalTests/BlockHandlers/BatteryBlockTests.cs @@ -91,6 +91,30 @@ public void GetTheBatteryInput() { } } + [TestMethod] + public void GetTheBatteryOutputLimit() { + using (ScriptTest test = new ScriptTest(@"Print ""Battery Output Limit: "" + the ""test battery"" output limit")) { + Mock mockBattery = new Mock(); + test.MockBlocksOfType("test battery", mockBattery); + mockBattery.Setup(b => b.MaxOutput).Returns(12f); + test.RunUntilDone(); + + Assert.AreEqual("Battery Output Limit: 12", test.Logger[0]); + } + } + + [TestMethod] + public void GetTheBatteryInputLimit() { + using (ScriptTest test = new ScriptTest(@"Print ""Battery Input Limit: "" + the ""test battery"" input limit")) { + Mock mockBattery = new Mock(); + test.MockBlocksOfType("test battery", mockBattery); + mockBattery.Setup(b => b.MaxInput).Returns(2f); + test.RunUntilDone(); + + Assert.AreEqual("Battery Input Limit: 2", test.Logger[0]); + } + } + [TestMethod] public void IsTheBatteryRecharging() { using (ScriptTest test = new ScriptTest(@"Print ""Charging: "" + the ""test battery"" is recharging")) { diff --git a/EasyCommands.Tests/ScriptTests/FunctionalTests/Selectors/SelectorWordTests.cs b/EasyCommands.Tests/ScriptTests/FunctionalTests/Selectors/SelectorWordTests.cs index d50e0e9..5651074 100644 --- a/EasyCommands.Tests/ScriptTests/FunctionalTests/Selectors/SelectorWordTests.cs +++ b/EasyCommands.Tests/ScriptTests/FunctionalTests/Selectors/SelectorWordTests.cs @@ -63,8 +63,8 @@ public void CameraSelector() { [TestMethod] public void CockpitSelector() { TestExpectedSelectorWords( - Words("cockpit", "ship", "rover", "seat", "station"), - Words("cockpits", "ships", "rovers", "seats", "stations") + Words("cockpit", "ship", "rover", "seat", "station", "helm"), + Words("cockpits", "ships", "rovers", "seats", "stations", "helms") ); } diff --git a/EasyCommands/BlockHandlers/BatteryBlockHandlers.cs b/EasyCommands/BlockHandlers/BatteryBlockHandlers.cs index 814188d..18140f7 100644 --- a/EasyCommands/BlockHandlers/BatteryBlockHandlers.cs +++ b/EasyCommands/BlockHandlers/BatteryBlockHandlers.cs @@ -28,6 +28,8 @@ public BatteryBlockHandler() { AddNumericHandler(Property.INPUT, b => b.CurrentInput); AddNumericHandler(Property.VOLUME, b => b.CurrentOutput); AddNumericHandler(Property.LEVEL, b => b.CurrentStoredPower); + AddPropertyHandler(NewList(Property.VOLUME, Property.RANGE), NumericHandler(b => b.MaxOutput)); + AddPropertyHandler(NewList(Property.INPUT, Property.RANGE), NumericHandler(b => b.MaxInput)); defaultPropertiesByPrimitive[Return.NUMERIC] = Property.RATIO; defaultPropertiesByDirection[Direction.UP] = Property.RATIO; } diff --git a/EasyCommands/CommandParsers/ParameterParsers.cs b/EasyCommands/CommandParsers/ParameterParsers.cs index 5c91b71..e05d57f 100644 --- a/EasyCommands/CommandParsers/ParameterParsers.cs +++ b/EasyCommands/CommandParsers/ParameterParsers.cs @@ -353,7 +353,7 @@ public void InitializeParsers() { AddBlockWords(Words("sensor"), Block.SENSOR); AddBlockWords(Words("beacon"), Block.BEACON); AddBlockWords(Words("antenna"), Block.ANTENNA); - AddBlockWords(Words("ship", "rover", "cockpit", "seat", "station"), Block.COCKPIT); + AddBlockWords(Words("ship", "rover", "cockpit", "seat", "station", "helm"), Block.COCKPIT); AddBlockWords(Words("cryo"), Block.CRYO_CHAMBER); AddBlockWords(Words("drone", "remote", "robot"), Block.REMOTE); AddBlockWords(Words("thruster"), Block.THRUSTER); diff --git a/docs/EasyCommands/blockHandlers/battery.md b/docs/EasyCommands/blockHandlers/battery.md index a6ffcc8..4fea2cd 100644 --- a/docs/EasyCommands/blockHandlers/battery.md +++ b/docs/EasyCommands/blockHandlers/battery.md @@ -98,10 +98,10 @@ set the "Ship Batteries" to auto * Primitive Type: Numeric * Keywords: ```limit, limits``` -Gets the maximum amount of power that the given battery is able to store. +Gets the maximum amount of power that the given battery is able to store, in MW. ``` -Print "Max Stored Power: " + the "Ship Batteries" limit, in MW +Print "Max Stored Power: " + the "Ship Batteries" limit ``` ## "Ratio" Property @@ -140,6 +140,17 @@ Returns a value representing the current input power to the battery, in MW / s. Print "Current Power Input: " + "Ship Batteries" input ``` +## "Input Limit" Property +* Read-only +* Primitive Type: Numeric +* Keywords: ```input limit, input limits``` + +Gets the maximum amount of power that the given battery can receive as input, in MW. + +``` +Print "Max Power Input: " + the "Ship Batteries" input limit +``` + ## "Output" Property * Read-only * Primitive Type: Numeric @@ -150,3 +161,14 @@ Returns a value representing the current output power from the battery, in MW / ``` Print "Current Power Output: " + "Ship Batteries" output ``` + +## "Output Limit" Property +* Read-only +* Primitive Type: Numeric +* Keywords: ```output limit, output limits``` + +Gets the maximum amount of power that the given battery is able to output, in MW. + +``` +Print "Max Power Output: " + the "Ship Batteries" output limit +``` diff --git a/docs/EasyCommands/blockHandlers/cockpit.md b/docs/EasyCommands/blockHandlers/cockpit.md index 9cce904..5d2c414 100644 --- a/docs/EasyCommands/blockHandlers/cockpit.md +++ b/docs/EasyCommands/blockHandlers/cockpit.md @@ -6,8 +6,8 @@ This handler enables you to listen for user input, which has all kinds of potent This Block Handler will only briefly touch on handling user input. For much more information, see [Handling User Input](https://spaceengineers.merlinofmines.com/EasyCommands/input "Handling User Input") -* Block Type Keywords: ```ship, rover, cockpit, seat, station``` -* Block Type Group Keywords: ```ships, rovers, cockpits, seats, stations``` +* Block Type Keywords: ```ship, rover, cockpit, seat, station, helm``` +* Block Type Group Keywords: ```ships, rovers, cockpits, seats, stations, helms``` Default Primitive Properties: * Boolean - Enabled diff --git a/docs/EasyCommands/cheatsheet.md b/docs/EasyCommands/cheatsheet.md index f98308b..ede35ed 100644 --- a/docs/EasyCommands/cheatsheet.md +++ b/docs/EasyCommands/cheatsheet.md @@ -39,8 +39,8 @@ These words are (mostly) ignored when parsing your script, but feel free to use * ```camera``` * ```cameras``` * Cockpit - * ```cockpit, ship, rover, seat, station``` - * ```cockpits, ships, rovers, seats, stations``` + * ```cockpit, ship, rover, seat, station, helm``` + * ```cockpits, ships, rovers, seats, stations, helms``` * Collector * ```collector``` * ```collectors```