Skip to content

Create an OrganizedListSerializer to allow for sorting of YAML lists.#6827

Open
Princess-Cheeseballs wants to merge 3 commits into
space-wizards:masterfrom
Princess-Cheeseballs:organizedlistserializer
Open

Create an OrganizedListSerializer to allow for sorting of YAML lists.#6827
Princess-Cheeseballs wants to merge 3 commits into
space-wizards:masterfrom
Princess-Cheeseballs:organizedlistserializer

Conversation

@Princess-Cheeseballs

Copy link
Copy Markdown
Member

Title.

Basically a generic version of the DamageThresholdSerializer I wrote for space-wizards/space-station-14#44644

I need the one in content merged ASAP cause we're running a bit too close to release, but I figured I could make this for engine because it's useful for ending a lot of the YAML rot that we have.

This benefit of this serializer is that you can have a bunch of list inheritance in YAML and have the serializer organize them for you, as well as combine objects in list entries the same was it does with a dictionary, without having to use a dictionary and with minimal boilerplate.

I made this while super fucking tired so the names suck and there's probably some performance hole I missed but otherwise I think it'll be useful to help with some YAML rot out there. Also basically requires [AlwaysPushInheritance] on the DataField or you're trolling.

@Princess-Cheeseballs

Copy link
Copy Markdown
Member Author

I hate the names I chose but I'm too eepy to think of better ones. First come first serve to bikeshed my naming conventions.

@metalgearsloth metalgearsloth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs test coverage.

@Princess-Cheeseballs

Copy link
Copy Markdown
Member Author

I'll address the review when I'm not eepy tomorrow.

Comment on lines +44 to +45
{
var sawmill = dependencies.Resolve<ILogManager>().GetSawmill("szr");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a dependency for this as a field since delta's pr.

@whatston3

Copy link
Copy Markdown
Contributor

I hate the names I chose but I'm too eepy to think of better ones. First come first serve to bikeshed my naming conventions.

SortedListSerializer? OrderedListSerializer? Maybe want to avoid allusions to C#'s SortedList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants