Code cleanup
This commit is contained in:
@@ -20,21 +20,16 @@ object OpenGotha {
|
|||||||
fun import(element: Element): Tournament<*> {
|
fun import(element: Element): Tournament<*> {
|
||||||
|
|
||||||
val context = JAXBContext.newInstance(ObjectFactory::class.java)
|
val context = JAXBContext.newInstance(ObjectFactory::class.java)
|
||||||
val parsed = context.createUnmarshaller()/*.also { unmarshaller ->
|
val parsed = context.createUnmarshaller().unmarshal(element) as JAXBElement<TournamentType>
|
||||||
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 ogt = parsed.value
|
val ogt = parsed.value
|
||||||
|
|
||||||
// import tournament parameters
|
// import tournament parameters
|
||||||
|
|
||||||
val genParams = ogt.tournamentParameterSet.generalParameterSet
|
val genParams = ogt.tournamentParameterSet.generalParameterSet
|
||||||
val handParams = ogt.tournamentParameterSet.handicapParameterSet
|
val handParams = ogt.tournamentParameterSet.handicapParameterSet
|
||||||
val placmtParams = ogt.tournamentParameterSet.placementParameterSet
|
val placmtParams = ogt.tournamentParameterSet.placementParameterSet
|
||||||
val pairParams = ogt.tournamentParameterSet.pairingParameterSet
|
val pairParams = ogt.tournamentParameterSet.pairingParameterSet
|
||||||
|
|
||||||
val tournament = StandardTournament(
|
val tournament = StandardTournament(
|
||||||
id = Store.nextTournamentId,
|
id = Store.nextTournamentId,
|
||||||
type = Tournament.Type.INDIVIDUAL, // CB for now, TODO
|
type = Tournament.Type.INDIVIDUAL, // CB for now, TODO
|
||||||
|
Reference in New Issue
Block a user