Open deltanedas opened 4 months ago
Was literally just thinking about this
another example usecase
# pai that can play music
- type: entity
id: PAIMusic
- type: UserInterface
interfaces:
enum.MusicUiKey.Key:
type: MusicBoundUserInterface
# pai that has map AND music
- type: entity
parent: PAIMusic
id: PAIMap
components:
- type: UserInterface
interfaces: !Add
enum.MapUiKey.Key:
type: MapBoundUserInterface
# an expansion card that adds a userinterface regardless of what the pai already had
# so ComponentRegistry has to support this syntax too
# right now this has a shitty boilerplate AddUserInterface component that does this by hand
- type: entity
id: CoolCard
components:
- type: PAIExpansionCard
components:
- type: UserInterface
interfaces: !Add
enum.CoolUiKey.Key:
type: CoolUserInterface
# combining add and remove in the entity prototype and a registry
# a card that removes midi player if you are a bad person, and also has the cool ui
- type: entity
parent: CoolCard
id: EvilCard
components:
- type: PAIExpansionCard
components: !Add # keep the CoolUi with this module
- type: UserInterface
interfaces: !Remove # uses just key instead of key: value
- enum.MusicUiKey.Key
- type: ChemicalPayload
beakerSlotA: &slotDef
whitelist:
components:
- FitsInDispenser
swap: false
beakerSlotB: *slotDef
it seems to be already parsing special stuff to copy paste, so there must be a way this could be implemented, maybe reusing the symbols if ! isnt possible
something like
then "just" handle the Add Remove markers by looking up the parent prototype and adding or removing
presumably this would only be possible on fields of the component, and not fields of those fields