Example #1
0
        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);
            }
        }
Example #2
0
 public Chamber(ChamberInfo info)
 {
     m_Switch  = new ChamberSwitch(this, info.SwitchLocation, info.SwitchId);
     m_Barrier = new ChamberBarrier(info.BarrierLocation);
 }
Example #3
0
 public Chamber( ChamberInfo info )
 {
     m_Switch = new ChamberSwitch( this, info.SwitchLocation, info.SwitchId );
     m_Barrier = new ChamberBarrier( info.BarrierLocation );
 }