mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Add independent sendGraphics method to ContentAPI.
This commit is contained in:
parent
c95d86e0f4
commit
9e23e0d243
1 changed files with 13 additions and 0 deletions
|
|
@ -1230,4 +1230,17 @@ object ContentAPI {
|
|||
fun sendNews(message: String){
|
||||
Repository.sendNews(message, 12, "CC6600")
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a given Graphics object, or graphics ID, to the given location.
|
||||
* @param gfx the Graphics object, or the Integer ID of the graphics, to send. Either works.
|
||||
* @param location the location to send it to
|
||||
*/
|
||||
@JvmStatic
|
||||
fun <G> sendGraphics(gfx: G, location: Location){
|
||||
when(gfx){
|
||||
is Int -> Graphics.send(Graphics(gfx),location)
|
||||
is Graphics -> Graphics.send(gfx, location)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue