We'll have game mechanics like troughs that have multiple switches (and coils). I think the best way to support them without making everything incredibly complicated is to interpret them as "source".
I would imagine having an interface like that:
public interface ISwitchDevice
{
string Name { get; }
IEnumerable<GamelogicEngineSwitch> Switches;
}
Our trough component would then implement this interface, and it thus appear in the switch manager as additional source:

Data-wise, we have two possibilities:
- Change
Source from int to string, and introduce "special" values for input system, playfield, constant (maybe prefix with double underscore?)
- Add an other
DeviceSource field that is a string, and add another Source value (e.g. -1 = use DeviceSource)
I would prefer 2. since it's more proper. We also need to store the actual value in a new field, let's say DeviceItem.
So for the trough example above, we would have the following data:
Id = "15"
Description = "Trough I"
Source = SwitchSource.Device
DeviceSource = "Trough"
DeviceItem = "Switch I"
Type = SwitchType.OnOff
We'll have game mechanics like troughs that have multiple switches (and coils). I think the best way to support them without making everything incredibly complicated is to interpret them as "source".
I would imagine having an interface like that:
Our trough component would then implement this interface, and it thus appear in the switch manager as additional source:
Data-wise, we have two possibilities:
Sourcefrom int to string, and introduce "special" values for input system, playfield, constant (maybe prefix with double underscore?)DeviceSourcefield that is a string, and add anotherSourcevalue (e.g. -1 = useDeviceSource)I would prefer 2. since it's more proper. We also need to store the actual value in a new field, let's say
DeviceItem.So for the trough example above, we would have the following data:
Id= "15"Description= "Trough I"Source=SwitchSource.DeviceDeviceSource= "Trough"DeviceItem= "Switch I"Type=SwitchType.OnOff