Coverage Summary for Class: WorldOverview (com.galarzaa.tibiakt.core.section.community.world.model)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| WorldOverview |
50%
(2/4)
|
0%
(0/4)
|
71.4%
(5/7)
|
60.2%
(68/113)
|
| WorldOverview$Companion |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/2)
|
| Total |
40%
(2/5)
|
0%
(0/4)
|
62.5%
(5/8)
|
59.1%
(68/115)
|
/*
* Copyright © 2025 Allan Galarza
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.galarzaa.tibiakt.core.section.community.world.model
import com.galarzaa.tibiakt.core.section.community.urls.worldOverviewUrl
import kotlinx.serialization.Serializable
import kotlin.time.Instant
/**
* The world overview section in Tibia.com.
*
* @property overallMaximumCount The record for simultaneous online players.
* @property overallMaximumCountAt The date and time when the record for online players was set.
* @property worlds The list of available worlds.
*/
@Serializable
public data class WorldOverview(
val overallMaximumCount: Int,
val overallMaximumCountAt: Instant,
val worlds: List<WorldEntry>,
) {
/**
* The total of currently online players across worlds.
*/
val totalOnline: Int
get() = worlds.sumOf { it.onlinePlayersCount }
/**
* The URL to the world overview section.
*/
val url: String
get() = worldOverviewUrl()
}