public static void Generate() { if (ChamberLever.Levers.Count == 0) { return; } for (var index = 0; index < m_ChamberInfos.Length; index++) { ChamberInfo info = m_ChamberInfos[index]; m_Chambers.Add(new Chamber(info)); } // randomize List <ChamberLever> levers = new List <ChamberLever>(ChamberLever.Levers); for (var index = 0; index < m_Chambers.Count; index++) { Chamber chamber = m_Chambers[index]; int idx = Utility.Random(levers.Count); chamber.Lever = levers[idx]; levers[idx].Chamber = chamber; levers.RemoveAt(idx); } }
public Chamber(ChamberInfo info) { m_Switch = new ChamberSwitch(this, info.SwitchLocation, info.SwitchId); m_Barrier = new ChamberBarrier(info.BarrierLocation); }
public Chamber( ChamberInfo info ) { m_Switch = new ChamberSwitch( this, info.SwitchLocation, info.SwitchId ); m_Barrier = new ChamberBarrier( info.BarrierLocation ); }