55 lines
1.3 KiB
Kotlin
55 lines
1.3 KiB
Kotlin
package database
|
|
|
|
import content.Category
|
|
|
|
data class Soundbank(
|
|
var index: UInt,
|
|
var Description: String,
|
|
var TAG : String,
|
|
var Category: String,
|
|
var Language: String,
|
|
var VoiceType: String,
|
|
var Path: String,
|
|
){
|
|
|
|
/**
|
|
* Check if all fields are not empty
|
|
*/
|
|
fun isNotEmpty(): Boolean{
|
|
if (Description.isNotEmpty()){
|
|
if (TAG.isNotEmpty()){
|
|
if (Category.isNotEmpty()){
|
|
if (Language.isNotEmpty()){
|
|
if (VoiceType.isNotEmpty()){
|
|
if (Path.isNotEmpty()){
|
|
return true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
/**
|
|
* Check if Category is valid
|
|
*/
|
|
fun ValidCategory() : Boolean{
|
|
return content.Category.entries.any{ it.name == this.Category}
|
|
}
|
|
|
|
/**
|
|
* Check if VoiceType is valid
|
|
*/
|
|
fun ValidVoiceType() : Boolean{
|
|
return content.VoiceType.entries.any{ it.name == this.VoiceType}
|
|
}
|
|
/**
|
|
* Check if Language is valid
|
|
*/
|
|
fun ValidLanguage() : Boolean{
|
|
return content.Language.entries.any{ it.name == this.Language}
|
|
}
|
|
}
|