Exemplo n.º 1
0
        public void WriteRecurrant <T>(T value, Husker <T> husker)
        {
            int id;

            if (recurrant_objects.TryGetValue(value, out id))
            {
                writer.Write(id);
            }
            else
            {
                id = next_id++;

                writer.Write(id);
                recurrant_objects.Add(value, id);

                husker.Dehydrate(this, value);
            }
        }
Exemplo n.º 2
0
        public override void Dehydrate(HuskWriter writer, List <T> to_dehydrate)
        {
            writer.WriteInt(to_dehydrate.Count);

            to_dehydrate.Process(i => husker.Dehydrate(writer, i));
        }