Ejemplo n.º 1
0
        public void RepopulateHardware(IGamelogicEngine gle)
        {
            MappingConfig.Clear(false);
            MappingConfig.PopulateSwitches(gle.RequestedSwitches, this);
            MappingConfig.PopulateLamps(gle.RequestedLamps, this);
            MappingConfig.PopulateCoils(gle.RequestedCoils, this);
            MappingConfig.PopulateWires(gle.AvailableWires, this);

            // hook up plunger
            var plunger = GetComponentInChildren <PlungerComponent>();

            if (plunger)
            {
                const string description    = "Manual Plunger";
                var          plungerMapping = MappingConfig.Wires.FirstOrDefault(mc => mc.Description == description);
                if (plungerMapping == null)
                {
                    var mapping = new WireMapping().WithId();
                    mapping.Description           = description;
                    mapping.Source                = SwitchSource.InputSystem;
                    mapping.SourceInputActionMap  = InputConstants.MapCabinetSwitches;
                    mapping.SourceInputAction     = InputConstants.ActionPlunger;
                    mapping.DestinationDevice     = plunger;
                    mapping.DestinationDeviceItem = PlungerComponent.PullCoilId;
                    MappingConfig.AddWire(mapping);
                }
            }
        }
Ejemplo n.º 2
0
 public void RemoveWire(WireMapping wireMapping)
 {
     Wires.Remove(wireMapping);
 }
Ejemplo n.º 3
0
 public void AddWire(WireMapping wireMapping)
 {
     Wires.Add(wireMapping);
 }