From 9e23e0d243f78f4ebb13e708be82325e65c54cc8 Mon Sep 17 00:00:00 2001 From: ceikry Date: Sun, 22 Aug 2021 16:42:35 -0500 Subject: [PATCH] Add independent sendGraphics method to ContentAPI. --- Server/src/main/kotlin/api/ContentAPI.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Server/src/main/kotlin/api/ContentAPI.kt b/Server/src/main/kotlin/api/ContentAPI.kt index c76a47259..dff42dfcd 100644 --- a/Server/src/main/kotlin/api/ContentAPI.kt +++ b/Server/src/main/kotlin/api/ContentAPI.kt @@ -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 sendGraphics(gfx: G, location: Location){ + when(gfx){ + is Int -> Graphics.send(Graphics(gfx),location) + is Graphics -> Graphics.send(gfx, location) + } + } } \ No newline at end of file