public virtual void Action(ISwitchRoom switchRoom, Notify Announce) { if (CountOfTheNumbersFirstSwitchFlipped != NumberOfTimesToFlipFirstSwitch) { ISwitch firstSwitch = switchRoom.GetSwithes().Where(s => Convert.ToInt32(s.GetSwitchIdentifier().GetIdentifier()).Equals(1)).Select(s => s).First(); if (firstSwitch.GetSwitchPosition() == FlipFirstSwitchPostion) { firstSwitch.FlipSwitchPosition(); CountOfTheNumbersFirstSwitchFlipped++; return; } } ISwitch secondSwitch = switchRoom.GetSwithes().Where(s => Convert.ToInt32(s.GetSwitchIdentifier().GetIdentifier()).Equals(2)).Select(s => s).First(); secondSwitch.FlipSwitchPosition(); }
public SwitchRoomPicture(IPrisoner prisoner, ISwitchRoom switchRoom) { Prisoner = prisoner; Switches = new List <ISwitch>(); foreach (ISwitch sw in switchRoom.GetSwithes()) { Switches.Add(sw.Clone() as ISwitch); } }