Ejemplo n.º 1
0
 /// <summary>
 /// Set up this switch to send its status to the gamelogic engine with the given ID.
 /// </summary>
 /// <param name="switchConfig">Config containing gamelogic engine's switch ID and pulse settings</param>
 public void AddSwitchId(SwitchConfig switchConfig)
 {
     if (_switchIds == null)
     {
         _switchIds = new List <SwitchConfig>();
     }
     _switchIds.Add(switchConfig);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Set up this switch to send its status to the gamelogic engine with the given ID.
        /// </summary>
        /// <param name="switchConfig">Config containing gamelogic engine's switch ID and pulse settings</param>
        /// <param name="switchStatus">Since multiple switch destinations can map to a switch, we might already have a status object.</param>
        internal IApiSwitchStatus AddSwitchDest(SwitchConfig switchConfig, IApiSwitchStatus switchStatus)
        {
            if (_switches == null)
            {
                _switches = new List <SwitchConfig>();
            }

            var swStatus = switchStatus ?? new ItemSwitchStatus(switchConfig.IsNormallyClosed)
            {
                IsSwitchEnabled = IsEnabled
            };

            _switches.Add(switchConfig);
            _switchStatuses[switchConfig.SwitchId] = swStatus;

            return(swStatus);
        }
Ejemplo n.º 3
0
 IApiSwitchStatus IApiSwitch.AddSwitchDest(SwitchConfig switchConfig, IApiSwitchStatus switchStatus) => AddSwitchDest(switchConfig.WithPulse(true), switchStatus);
Ejemplo n.º 4
0
 protected void AddSwitchId(SwitchConfig switchConfig) => _switchHandler.AddSwitchId(switchConfig);
Ejemplo n.º 5
0
 IApiSwitchStatus IApiSwitch.AddSwitchDest(SwitchConfig switchConfig, IApiSwitchStatus switchStatus) => AddSwitchDest(switchConfig, switchStatus);
Ejemplo n.º 6
0
 void IApiSwitch.AddSwitchId(SwitchConfig switchConfig) => AddSwitchId(switchConfig.WithPulse(Item.IsPulseSwitch));
Ejemplo n.º 7
0
 private protected IApiSwitchStatus AddSwitchDest(SwitchConfig switchConfig, IApiSwitchStatus switchStatus) => SwitchHandler.AddSwitchDest(switchConfig, switchStatus);
Ejemplo n.º 8
0
 IApiSwitchStatus IApiSwitch.AddSwitchDest(SwitchConfig switchConfig, IApiSwitchStatus switchStatus) =>
 _switchHandler.AddSwitchDest(switchConfig.WithPulse(_isPulseSwitch).WithDefault(_switchDefault), switchStatus);