Ejemplo n.º 1
0
        public void Run()
        {
            //Existing Stuff in house
            Light          BedroomLights = new Light();
            AirConditioner AC            = new AirConditioner();

            //Prepare Commands
            LightsOn TurnBedroomLightOn = new LightsOn(BedroomLights);
            AirConOn TurnAirConOn       = new AirConOn(AC);

            LightsOff TurnBedRoomLightOff = new LightsOff(BedroomLights);
            AirConOff TurnAirConOff       = new AirConOff(AC);

            //Controller

            RemoteControl RemoteControl = new RemoteControl();

            RemoteControl.InsertNewCommandOn(TurnBedroomLightOn);
            RemoteControl.InsertNewCommandOn(TurnAirConOn);
            RemoteControl.InsertNewCommandOff(TurnBedRoomLightOff);
            RemoteControl.InsertNewCommandOff(TurnAirConOff);

            //Test
            RemoteControl.TurnOn(0);
            RemoteControl.TurnOn(1);
            RemoteControl.TurnOff(0);
            RemoteControl.TurnOff(1);
        }
Ejemplo n.º 2
0
        public void Switchlights() // methode waarbij de lichten aan- of uitgezet worden, alternerend
        {
            if (switchCount >= MaxSwitch)
            {
                throw new Exception("to turn the lights on and off is NOT 5 times");
            }
            LightsOn?.Invoke(this, new LightsOnEventArgs()); //aanroep event "LightsOn" als niet null en geef kleur

            LightsOff?.Invoke(this, EventArgs.Empty);        // aabroep event "LightsOff.
            switchCount++;
        }
Ejemplo n.º 3
0
        public bool Equals(Vehicle other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Type.Equals(other.Type) &&
                   ModelIndex.Equals(other.ModelIndex) &&
                   Handle.Equals(other.Handle) &&
                   Matrix.Equals(other.Matrix) &&
                   EntityType.Equals(other.EntityType) &&
                   EntityStatus.Equals(other.EntityStatus) &&
                   EntityFlags.Equals(other.EntityFlags) &&
                   AutoPilot.Equals(other.AutoPilot) &&
                   Color1.Equals(other.Color1) &&
                   Color2.Equals(other.Color2) &&
                   AlarmState.Equals(other.AlarmState) &&
                   MaxNumPassengers.Equals(other.MaxNumPassengers) &&
                   Field1D0h.Equals(other.Field1D0h) &&
                   Field1D4h.Equals(other.Field1D4h) &&
                   Field1D8h.Equals(other.Field1D8h) &&
                   Field1DCh.Equals(other.Field1DCh) &&
                   SteerAngle.Equals(other.SteerAngle) &&
                   GasPedal.Equals(other.GasPedal) &&
                   BrakePedal.Equals(other.BrakePedal) &&
                   CreatedBy.Equals(other.CreatedBy) &&
                   IsLawEnforcer.Equals(other.IsLawEnforcer) &&
                   IsLockedByScript.Equals(other.IsLockedByScript) &&
                   IsEngineOn.Equals(other.IsEngineOn) &&
                   IsHandbrakeOn.Equals(other.IsHandbrakeOn) &&
                   LightsOn.Equals(other.LightsOn) &&
                   HasFreebies.Equals(other.HasFreebies) &&
                   Health.Equals(other.Health) &&
                   CurrentGear.Equals(other.CurrentGear) &&
                   ChangeGearTime.Equals(other.ChangeGearTime) &&
                   TimeOfDeath.Equals(other.TimeOfDeath) &&
                   BombTimer.Equals(other.BombTimer) &&
                   DoorLock.Equals(other.DoorLock));
        }
    void Awake()
    {
        lights = gameObject.GetComponentsInChildren<Light>();
        flames = gameObject.GetComponentInChildren<ParticleSystem>();
        if ((row == 0 || row == 2) || (column == 0 || column == 2))
        {
            lights[0].enabled = false;
            lights[1].enabled = false;
            lights[2].enabled = false;
            flames.Pause();
            flames.Clear();
            isActive = false;
        }

        puzzleManager = GameObject.FindObjectOfType<LightsOn>();
    }