missionpinball / mpf

Mission Pinball Framework: Open source software to run a real pinball machine.
http://missionpinball.org
MIT License
215 stars 142 forks source link

Prototype for Data Modelling #1053

Open jabdoa2 opened 6 years ago

jabdoa2 commented 6 years ago

Implement the Prototype pattern for devices in config. They should be able to specify a prototype and overwrite all attributes. We probably need a way to mark devices as abtract/prototype to prevent instantiating them.

Further reading: http://gameprogrammingpatterns.com/prototype.html#prototypes-for-data-modeling

jabdoa2 commented 6 years ago

Example with lights:

lights:
  playfield_insert: # WS2812
    _prototype: True
    type: grb
    tags: playfield
  playfield_gi: # WS2811
    _prototype: True
    type: rgb
    tags: playfield, gi
  l_my_insert1:
    number: 0-1
    prototype: playfield_insert
  l_my_gi1:
    number: 1-1
    prototype: playfield_gi
thakkardharmik commented 6 years ago

@jabdoa2 Is this still open? I would like to give it a try.

jabdoa2 commented 6 years ago

Welcome to MPF! Yes this open. Let me know if you have any questions.