Proposal for the code standards - OOP abstract standard #8038
EvilDragonfiend
started this conversation in
Design Proposals
Replies: 1 comment
-
rewording: "single item itself is fine to be alone, but once someone makes a subtype of it, they should inherit the original parent into subtype." rewording2: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
when you make a parent of stuff, it shouldn't be used basically.
felinid is human with cat ears. felinid itself pathing is fine. but it comes to problem when you need to check if a type is
human
orfelinid
.the other 'species check' codes are simple.
but as you saw from the image, checking
human
orfelinid
is very ugly since you need to check the parent type separately.so, you need to code like
Let's say you have a radio, and you're going to make its subtypes
/obj/item/radio
will be the basic item./obj/item/radio/headset
and/obj/item/radio/intercom
are its subtypes./obj/item/radio
is now in issue. If you want a specific feature for "station bounced radio", it's added to the other subtype items.For example, if
station bounced radio
has wire component. This means you need to disable the wire component of its subtype items - like headsets. why would you want wire component from headset?so,
station bounced radio
must be/obj/item/radio/handradio
if you want a specific wire component for this.the point of this idea is not to have its parent type to be used main contents for an item. If you inherit a subtype from a thing where the parent type was the only stuff at the moment, its parent should be inherited too into a new subtype. <- main point
Beta Was this translation helpful? Give feedback.
All reactions