From 3f553290edf0a8d8c1d9379f0a82156143be9981 Mon Sep 17 00:00:00 2001 From: devxb Date: Tue, 3 Dec 2024 21:27:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20SNOW=5FHOUSE=5FFIELD=EB=A5=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gitanimals/render/domain/FieldType.kt | 500 +++++++++++++++++- .../org/gitanimals/render/domain/Svgs.kt | 3 + .../persona/field/snow-house-field.svg | 10 + 3 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/persona/field/snow-house-field.svg diff --git a/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt b/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt index e58a0f2..7f1edcf 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt @@ -304,7 +304,505 @@ enum class FieldType { override fun drawBorder(): String { return "" } - } + }, + SNOW_HOUSE_FIELD { + override fun loadComponent(name: String, commit: Long): String { + return snowHouseFieldSvg.replace(NAME_FIX, name.toSvg(0.0, 3.0)) + .replace(COMMIT_FIX, commit.toSvg("commit", 260.0, 4.0)) + } + + override fun fillBackground(): String { + return """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """.trimIndent() + } + + override fun drawBorder(): String { + return "" + } + }, ; abstract fun loadComponent(name: String, commit: Long): String diff --git a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt index e8fed39..5b3b757 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -18,6 +18,9 @@ val halloweenFieldSvg: String = ClassPathResource("persona/field/halloween-field val grassFieldSvg: String = ClassPathResource("persona/field/grass-field.svg") .getContentAsString(Charset.defaultCharset()) +val snowHouseFieldSvg: String = ClassPathResource("persona/field/snow-house-field.svg") + .getContentAsString(Charset.defaultCharset()) + val gooseSvg: String = ClassPathResource("persona/animal/goose.svg") .getContentAsString(Charset.defaultCharset()) diff --git a/src/main/resources/persona/field/snow-house-field.svg b/src/main/resources/persona/field/snow-house-field.svg new file mode 100644 index 0000000..4cf5285 --- /dev/null +++ b/src/main/resources/persona/field/snow-house-field.svg @@ -0,0 +1,10 @@ + + *{username} + + + + + + *{commit-count} + +