-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netutil cleanup #1273
Netutil cleanup #1273
Conversation
kianzarrin
commented
Jan 4, 2022
•
edited
Loading
edited
- moved network related utilities to extensions.
- moved iterators to iterator subfolder
- introduced LaneUtil.
- I have marked some methods as obsolete instead of removing them to avoid big changes.
moved iterators to iterators folder
created LaneUtil
TLM/TLM/UI/MainMenu/DebugMenu.cs
Outdated
@@ -191,9 +192,10 @@ public class DebugMenuPanel : UIPanel | |||
private void ClickGoToNode(UIComponent component, UIMouseEventParameter eventParam) { | |||
ushort nodeId = Convert.ToUInt16(_goToField.text); | |||
|
|||
if ((nodeId.ToNode().m_flags & NetNode.Flags.Created) != NetNode.Flags.None) { | |||
CSUtil.CameraControl.CameraController.Instance.GoToNode(nodeId); | |||
if ((nodeId.ToNode().m_flags & NetNode.Flags.Created) == NetNode.Flags.None) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unintended change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is result of auto-fix.
at least the functionality has not change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok reverted it.
@aubergine10 note that I have merely moved the code. I have not written any new code. So I prefer not to change things too much. Maybe just IsFlagSet and LHT ? |
Yup, the other stuff can come later. Want me to create issues to track that, or...? |
Do you think we need an issue for ternary condition instead of if/else ? Some coding standards ban using ternary if as it can cause confusion. I think for the sake of TMPE either should be acceptable. More over any change of code that has been thoroughly tested for years can introduce new points of failure. as for the magic number, and some other stuff you can open an issue. BTW if this is performance critical then we have a problem with producing too much garbage and using slow code. |
maybe when you opened an issue I can reference it in the TODO over there. |
@aubergine10 I made a few changes but please mark everything inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like this
I hope you didn't forget about this |
TLM/TLM/Util/LaneUtil.cs
Outdated
if (curLaneId == laneId) { | ||
return laneIndex; | ||
} | ||
laneIndex++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you commit to wrong branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep it's a bug here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that is a bug that I already fix. I am surprised the fix was not uploaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had committed the fix to the wrong branch. now is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍