f14337f397c43996b5b9d6791a670804e6a81ae3
[rhynodge.git] / src / main / kotlin / net / pterodactylus / rhynodge / webpages / weather / wettercom / WetterComState.kt
1 package net.pterodactylus.rhynodge.webpages.weather.wettercom
2
3 import net.pterodactylus.rhynodge.states.AbstractState
4 import java.time.LocalDateTime
5
6 /**
7  * Contains the state parsed from [wetter.com](https://www.wetter.com/).
8  *
9  * @author [David ‘Bombe’ Roden](mailto:bombe@pterodactylus.net)
10  */
11 class WetterComState(val dateTime: LocalDateTime) : AbstractState(true) {
12
13     val hours: List<HourState> = mutableListOf()
14
15     fun addHour(hourState: HourState) {
16         (hours as MutableList<HourState>).add(hourState)
17     }
18
19     override fun equals(other: Any?): Boolean {
20         other as? WetterComState ?: return false
21         return (dateTime == other.dateTime) and (hours == other.hours)
22     }
23
24 }