Exemplo n.º 1
0
        /// <summary>
        /// Write out Game end using the supplied StreamWriter
        /// </summary>
        /// <param name="cmpw">ClrMameProWriter to output to</param>
        /// <param name="datItem">DatItem object to be output</param>
        private void WriteEndGame(ClrMameProWriter cmpw, DatItem datItem)
        {
            // Build the state
            cmpw.WriteOptionalStandalone("sampleof", datItem.Machine.SampleOf);

            // End game
            cmpw.WriteEndElement();

            cmpw.Flush();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Write out DAT header using the supplied StreamWriter
        /// </summary>
        /// <param name="cmpw">ClrMameProWriter to output to</param>
        private void WriteHeader(ClrMameProWriter cmpw)
        {
            cmpw.WriteStartElement("clrmamepro");

            cmpw.WriteRequiredStandalone("name", Header.Name);
            cmpw.WriteRequiredStandalone("description", Header.Description);
            cmpw.WriteOptionalStandalone("category", Header.Category);
            cmpw.WriteRequiredStandalone("version", Header.Version);
            cmpw.WriteOptionalStandalone("date", Header.Date);
            cmpw.WriteRequiredStandalone("author", Header.Author);
            cmpw.WriteOptionalStandalone("email", Header.Email);
            cmpw.WriteOptionalStandalone("homepage", Header.Homepage);
            cmpw.WriteOptionalStandalone("url", Header.Url);
            cmpw.WriteOptionalStandalone("comment", Header.Comment);
            cmpw.WriteOptionalStandalone("forcezipping", Header.ForcePacking.FromPackingFlag(true), false);
            cmpw.WriteOptionalStandalone("forcemerging", Header.ForceMerging.FromMergingFlag(false), false);

            // End clrmamepro
            cmpw.WriteEndElement();

            cmpw.Flush();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Write out Game start using the supplied StreamWriter
        /// </summary>
        /// <param name="cmpw">ClrMameProWriter to output to</param>
        /// <param name="datItem">DatItem object to be output</param>
        private void WriteStartGame(ClrMameProWriter cmpw, DatItem datItem)
        {
            // No game should start with a path separator
            datItem.Machine.Name = datItem.Machine.Name.TrimStart(Path.DirectorySeparatorChar);

            // Build the state
            cmpw.WriteStartElement(datItem.Machine.MachineType == MachineType.Bios ? "resource" : "game");

            cmpw.WriteRequiredStandalone("name", datItem.Machine.Name);
            cmpw.WriteOptionalStandalone("romof", datItem.Machine.RomOf);
            cmpw.WriteOptionalStandalone("cloneof", datItem.Machine.CloneOf);
            cmpw.WriteOptionalStandalone("description", datItem.Machine.Description ?? datItem.Machine.Name);
            cmpw.WriteOptionalStandalone("year", datItem.Machine.Year);
            cmpw.WriteOptionalStandalone("manufacturer", datItem.Machine.Manufacturer);
            cmpw.WriteOptionalStandalone("category", datItem.Machine.Category);

            cmpw.Flush();
        }