-
Notifications
You must be signed in to change notification settings - Fork 651
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
Separate crate machine from market system #2681
Conversation
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.
Looked through this - one issue and one small gripe.
I think you could fire off events from the animation system itself instead of using delegates, seems closer to ECS and less OO.
I also think the CrateMachineVisualState could be scoped outside of the component.
Looks fine skimming it, will test briefly.
Content.Server/_NF/CrateMachine/CrateMachineSystem.Animation.cs
Outdated
Show resolved
Hide resolved
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.
Put in a few small suggestions.
I would honestly recommend testing and pulling in https://github.com/new-frontiers-14/frontier-station-14/compare/rack-attack...whatston3:frontier-station-14:2025-01-20-rack-attack-suggestions?expand=1
Seems to work fine under modest tests.
Edit: The TransformSystem distance calc. is probably cleaner vs. Vector2, I'd recommend using that.
/// When calling <see cref="OpenFor"/>, the machine will open the door and give a callback to the given | ||
/// <see cref="ICrateMachineDelegate"/> when it is done opening. | ||
/// </summary> | ||
public sealed partial class CrateMachineSystem |
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.
public sealed partial class CrateMachineSystem | |
public sealed partial class CrateMachineSystem : SharedCrateMachineSystem |
Extend the shared version, add the needed import above?
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.
|
||
public sealed class MarketSystem : SharedMarketSystem | ||
public sealed class CrateMachineSystem: SharedCrateMachineSystem |
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.
public sealed class CrateMachineSystem: SharedCrateMachineSystem | |
public sealed partial class CrateMachineSystem : SharedCrateMachineSystem |
per https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods:
All the parts must use the partial keyword
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.
Thank you for the review. I've updated the code to match your suggestions and comments. |
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.
Marking as good to go, waiting for @whatston3 to confirm if needed.
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.
A few cleanup suggestions - "ChildClass : ParentClass" is pretty much the norm. Not sure exactly what configuration's setting that up for the IDE offhand, if there's a style guide config in the workspace.
Really minor stuff, and yes, sorry, I was wrong about the Client side MarketSystem.
Content.Server/_NF/CrateMachine/CrateMachineSystem.Animation.cs
Outdated
Show resolved
Hide resolved
Content.Shared/_NF/Market/Components/MarketItemSpawnerComponent.cs
Outdated
Show resolved
Hide resolved
Changes are really minor, just going to batch commit them and it's an approval from my side. |
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.
Not broken it seems
* Split crate machine * Move namespace for visual layers * Replace with event * Use Vector2.Distance * Remove CalculateDistance * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Use partial * Update FindNearestUnoccupied * Update MarketSystem.CrateMachine.cs * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Client CrateMachineSystem: not partial, colon spacing --------- Co-authored-by: Whatstone <[email protected]> Co-authored-by: Dvir <[email protected]>
* Split crate machine * Move namespace for visual layers * Replace with event * Use Vector2.Distance * Remove CalculateDistance * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Use partial * Update FindNearestUnoccupied * Update MarketSystem.CrateMachine.cs * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Client CrateMachineSystem: not partial, colon spacing --------- Co-authored-by: Whatstone <[email protected]> Co-authored-by: Dvir <[email protected]>
* Split crate machine * Move namespace for visual layers * Replace with event * Use Vector2.Distance * Remove CalculateDistance * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Use partial * Update FindNearestUnoccupied * Update MarketSystem.CrateMachine.cs * Update CrateMachineSystem.cs * Update CrateMachineSystem.cs * Client CrateMachineSystem: not partial, colon spacing --------- Co-authored-by: Whatstone <[email protected]> Co-authored-by: Dvir <[email protected]>
About the PR
Why / Balance
How to test
Start a round and aghost
teleport to cargo depot
sell iron ore
buy iron ore at market console
check if animation is correct and items and crate spawn correctly
check if animation closes when moving crate off the crate hole.
Media
Requirements
Breaking changes
none
Changelog