mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 07:18:57 +07:00
Using reflection to find and report deprecated uniques (#5276)
* Using reflection to find and report deprecated uniques * No kotlin reflection needed thank you very much
This commit is contained in:
@ -317,6 +317,14 @@ class Ruleset {
|
|||||||
" which does not fit parameter type" +
|
" which does not fit parameter type" +
|
||||||
" ${complianceError.acceptableParameterTypes.joinToString(" or ") { it.parameterName }} !"
|
" ${complianceError.acceptableParameterTypes.joinToString(" or ") { it.parameterName }} !"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val deprecationAnnotation = unique.type.declaringClass.getField(unique.type.name)
|
||||||
|
.getAnnotation(Deprecated::class.java)
|
||||||
|
if (deprecationAnnotation != null) {
|
||||||
|
// Not user-visible
|
||||||
|
println("$name's unique \"${unique.text}\" is deprecated ${deprecationAnnotation.message}," +
|
||||||
|
" replace with \"${deprecationAnnotation.replaceWith.expression}\"")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user