OpenXcom Forum

Modding => OXCE Suggestions NEW => OpenXcom Extended => OXCE Suggestions Archive => Topic started by: 0xEBJC on December 18, 2023, 05:31:44 pm

Title: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: 0xEBJC on December 18, 2023, 05:31:44 pm
I post this question below but didn't know if it was a good idea to post into a '[DONE]' topic

https://openxcom.org/forum/index.php/topic,11198.msg160045.html#msg160045

Like 'override' and 'update' that could duplicate / 'inherit' another entry?

I don't think this feature is implemented but would a great enhancement.

Sorry if this question has already been asked or implemented, doing my best to look for posted answers before asking.
Title: Re: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: Yankes on December 18, 2023, 06:16:47 pm
As I replayed in other topic, I do not plan adding some thing like this, too much work in implementation compared to benefits its give.
Title: Re: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: Meridian on December 18, 2023, 09:32:17 pm
Both the design and the implementation of the OpenXcom modding system does not support true inheritance.

(Unless you want to change the entire system,) it is not possible to implement this.
Title: Re: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: Yankes on December 18, 2023, 10:22:12 pm
Both the design and the implementation of the OpenXcom modding system does not support true inheritance.

(Unless you want to change the entire system,) it is not possible to implement this.
In theory we could simply implement this in term of C++ copy-constructor, but still even in this case we would need visit
each class and make it support correctly copying, that in some cases is not trivial.
Title: Re: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: Meridian on December 18, 2023, 10:59:34 pm
Even if you come up with some implementation ideas, design-wise it's still the opposite of well-defined.

Any hack, compromise or workaround will only make the already bad situation (a lot) worse.

We've beaten this dead horse enough, time to admit it's dead.
Title: Re: [Suggestion] 'inherit' rulesets option - duplication with minimal entrires
Post by: GumChewer on January 16, 2024, 07:52:53 pm
That feature would be great, because refNode only works within in the same yaml file.
I always wanted to implement this, or a similar, feature myself downstream.

An implementation in XXX::load(...) would be as easy as
const auto idSave = _id;
*this = mod.getXXX(node["copy"].as<std::string>());
_id = idSave;

But the implicit copy constructors are deleted on many/all relevant classes.
Undeleting them gives lengthy compiler errors somehow related to Y-script.
So I had to resort to a lengthy implementation of only selected tags.

It would be great if the implicit copy constructors would come back.