TheCitadelofRicks/src/main/kotlin/org/mosad/thecitadelofricks/DataTypes.kt

59 lines
2.3 KiB
Kotlin

/**
* TheCitadelofRicks
*
* Copyright 2019 <seil0@mosad.xyz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
package org.mosad.thecitadelofricks
import java.time.LocalDateTime
import java.util.*
// data classes for the course part
data class Course(val courseName: String, val courseLink: String)
data class CoursesMeta(val totalCourses: Int, val time: Long)
data class CoursesList(val meta: CoursesMeta, val courses: ArrayList<Course>)
// data classes for the Mensa part
data class Meal(val day: String, val heading: String, val parts: ArrayList<String>, val additives: String)
data class Meals(val meals: ArrayList<Meal>)
data class MensaWeek(val days: Array<Meals> = Array(7) { Meals(ArrayList()) })
data class MensaMeta(val mensaName: String, val time: Long)
data class Mensa(val meta: MensaMeta, val currentWeek: MensaWeek, val nextWeek: MensaWeek)
// data classes for the timetable part
data class Lesson(val lessonID: String, val lessonSubject: String, val lessonTeacher: String, val lessonRoom:String, val lessonRemark: String)
data class TimetableDay( val timeslots: Array<ArrayList<Lesson>> = Array(6) { ArrayList<Lesson>()})
data class TimetableWeek(val days: Array<TimetableDay> = Array(6) { TimetableDay() })
data class TimetableMeta(val courseName: String, val courseLink: String, var time: Long)
data class TimetableCourse(val meta: TimetableMeta, var currentWeek: TimetableWeek, var nextWeek: TimetableWeek)
// data classes for the status part
data class Status(val time: LocalDateTime, val coursesLastUpdate: Date, val mensaLastUpdate: Date, val hsoResponseCode: Int, val swfrResponseCode: Int)