Ejemplo n.º 1
0
        public void WriteYaml(IEmitter emitter, object value, Type type)
        {
            emitter.Emit(new MappingStart());

            switch ((IBook)value)
            {
            case Compendium compendium:
                Publisher.Compendium_ToYaml(emitter, compendium);
                break;

            case TomeOfChaos tome:
                Publisher.Tome_ToYaml(emitter, tome);
                break;

            case Herbal herbal:
                Publisher.Herbal_ToYaml(emitter, herbal);
                break;

            case SocialRegister socialRegister:
                Publisher.Register_ToYaml(emitter, socialRegister, Creator);
                break;

            case Dramaticon dramaticon:
                Publisher.Dramaticon_ToYaml(emitter, dramaticon);
                break;

            case Atlas atlas:
                Publisher.Atlas_ToYaml(emitter, atlas);
                break;

            default:
                throw new NotImplementedException($"Not ready to Write book type [{value.GetType().Name}].");
            }

            emitter.Emit(new MappingEnd());
        }