예제 #1
0
        public static IEnumerable <Day16.Packet> Packets(this string data)
        {
            var bits   = new Day16.BitReader(data);
            var packet = new Day16.Packet(bits);

            return(packet.Packets());
        }
예제 #2
0
        public static IEnumerable <Day16.Packet> Packets(this Day16.Packet packet)
        {
            foreach (var p in packet.SubPackets)
            {
                foreach (var sp in p.Packets())
                {
                    yield return(sp);
                }
            }

            yield return(packet);
        }