Issue 1099 dockingport spelling#1161
Conversation
DockingPortValue.cs * fix the spelling of the suffixes for acquire range, force, and torque. * throw deprecation exception directing the user to use the correct spelling if they use the old version.
DockingPortValue.cs * add a suffix `NODEPOSITION` which returns the position of the actual docking node itself, rather than the part's position * add a suffix `NODETYPE` to allow you to differentiate between different types of docking ports, in stock this is how you can tell the "size" of the docking port. PartValue.cs * expose the shared objects as a protected variable so that classes that inherit (like DockingPortValue) don't need to keep their own handle. * add new suffix `HASMODULE` which can be used to determine if a part has a specific module.
src/kOS/Suffixed/Part/PartValue.cs
Outdated
There was a problem hiding this comment.
Access from an inherited class is a little bit of a hybrid issue. I agree in concept with not publicly exposing the member variable itself, and I don't think we want this variable publicly exposed anyways. Protected fields are only accessible to inherited classes, which makes it helpful to not hold a 2nd handle to the object. I think I've always treated protected fields similarly to private. Would you prefer that I implement a protected property, or just add the 2nd handle to the DockingPortValue class?
There was a problem hiding this comment.
protected property with private setter would be fine.
PartValue.cs * Moved the SharedObjects field `shared` to a protected property with a private setter.
dockingport.rst * Fix the spelling on the documentation of the acquire suffixes * Add a warning identifying the breaking change.
|
Assuming no further review questions pop up, this should be ready. |
PartValue.cs * Apparently the implementation of HASMODULE did not get committed correctly. It usually helps if you actually change the copy/pasted suffix code :-)
Fix cooked steering
There was a problem hiding this comment.
These should be "0.18.0" not "18.0".
There was a problem hiding this comment.
That's odd for me to make that kind of mistake. Do you want to make the change in you're review commit, or do you need me to make the change?
There was a problem hiding this comment.
I won't be in a position to edit code until tomorrow morning. I can do it then or you can do it before if you like.
DockingPortValue.cs * Update version to 0.18.0 PartValue.cs * Remove old debug logging.
DockingPortValue.cs * Remove another extra debug log.
…g' into issue-1099-review Strange merge conflict on pure whitespace line that made no sense why it conflicted. Had to manually change it. Conflicts: src/kOS/Suffixed/Part/PartValue.cs
…w' into issue-1099-dockingport_spelling
|
@Dunbaratu should be good to go here. |
Fixes #1099
NODEPOSITIONandNODETYPEto make docking scripts a little easier and more accurate.HASMODULEsuffix to PartValue, so to easily determine if the part has a specified module.