コード例 #1
0
        internal void Meet(Reindeer reindeer)
        {
            lock (ReindeerGroup)
            {
                ReindeerGroup.Add(reindeer);

                if (ReindeerGroup.Count == 9)
                {
                    var awakeMessage = new ReindeerAwakeMessage(ReindeerGroup.ToList());

                    foreach (var reindeerToRemove in awakeMessage.Group)
                    {
                        ReindeerGroup.Remove(reindeerToRemove);
                    }

                    Santa.Awake(awakeMessage);
                }
            }
        }
コード例 #2
0
 public void Tie(Reindeer reindeer)
 {
     Reindeers.Add(reindeer);
     reindeer.Sleigh = this;
 }