示例#1
0
文件: Stairs.cs 项目: OlekNg/AHMED
 /// <summary>
 /// Set both entries (first with index 0, second - with index 1)
 /// </summary>
 /// <param name="se1">0 indexed entry</param>
 /// <param name="se2">1 indexed entry</param>
 public void SetEntries(StairsEntry se1, StairsEntry se2)
 {
     Entries[0] = se1;
     Entries[1] = se2;
     se1.BindStairs(this, 0);
     se2.BindStairs(this, 1);
 }
示例#2
0
        /// <summary>
        /// Counstrructor - initializes delay, passage and determine next step (exit from stairs)
        /// </summary>
        /// <param name="se">Stairs entry</param>
        /// <param name="em">Whole evacuation map</param>
        public StairsEvacuationElement(StairsEntry se, EvacuationMap em)
            : base(se.ConnectedStairs.Capacity)
        {
            _startingDelay = se.ConnectedStairs.Delay;
            _groups = new List<KeyValuePair<int, int>>();
            _entry = se;
            _secondEntry = se.ConnectedStairs.GetEntry(1 - se.ID);

            _exitEvacuationElement = em.Get(_entry.Position) ?? em.Get(_entry.Position.GetAdjacentPosition());
            _secondExitEvacuationElement = em.Get(_secondEntry.Position) ?? em.Get(_secondEntry.Position.GetAdjacentPosition());

            DetermineNextStep();
        }
示例#3
0
文件: Stairs.cs 项目: OlekNg/AHMED
 /// <summary>
 /// Simple constructor initializes all properties
 /// </summary>
 /// <param name="c">Capacity</param>
 /// <param name="d">Delay</param>
 public Stairs(int c, int d)
 {
     Entries = new StairsEntry[2];
     Capacity = c;
     Delay = d;
 }