Code cleanup

This commit is contained in:
Claude Brisson
2023-06-22 17:03:38 +02:00
parent 0c9b50822f
commit 0ae18ab765

View File

@@ -20,21 +20,16 @@ object OpenGotha {
fun import(element: Element): Tournament<*> {
val context = JAXBContext.newInstance(ObjectFactory::class.java)
val parsed = context.createUnmarshaller()/*.also { unmarshaller ->
val schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
val schemaURL = OpenGotha::class.java.getResource("/xsd/opengotha.xsd") ?: throw Error("opengotha.xsd not found")
val schema = schemaFactory.newSchema(schemaURL)
unmarshaller.schema = schema
}*/.unmarshal(element) as JAXBElement<TournamentType>
val parsed = context.createUnmarshaller().unmarshal(element) as JAXBElement<TournamentType>
val ogt = parsed.value
// import tournament parameters
val genParams = ogt.tournamentParameterSet.generalParameterSet
val handParams = ogt.tournamentParameterSet.handicapParameterSet
val placmtParams = ogt.tournamentParameterSet.placementParameterSet
val pairParams = ogt.tournamentParameterSet.pairingParameterSet
val tournament = StandardTournament(
id = Store.nextTournamentId,
type = Tournament.Type.INDIVIDUAL, // CB for now, TODO