From 2e6fd6e181eb75271eb34a93859a47031a3ec25b Mon Sep 17 00:00:00 2001 From: devxb Date: Wed, 30 Oct 2024 20:12:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20GRASS=5FFIELD=EC=99=80=20HALLOWEEN=5FFI?= =?UTF-8?q?ELD=EB=A5=BC=20=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 | 154 ++++++++++++++++++ .../org/gitanimals/render/domain/Svgs.kt | 6 + .../resources/persona/field/grass-field.svg | 10 ++ .../persona/field/halloween-field.svg | 10 ++ 4 files changed, 180 insertions(+) create mode 100644 src/main/resources/persona/field/grass-field.svg create mode 100644 src/main/resources/persona/field/halloween-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 2136b54..e58a0f2 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/FieldType.kt @@ -151,6 +151,160 @@ enum class FieldType { return "" } }, + HALLOWEEN_FIELD { + override fun loadComponent(name: String, commit: Long): String { + return halloweenFieldSvg.replace(NAME_FIX, name.toSvg(0.0, 3.0)) + .replace(COMMIT_FIX, commit.toSvg("commit", 260.0, 4.0)) + } + + override fun fillBackground(): String { + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + } + + override fun drawBorder(): String { + return "" + } + }, + GRASS_FIELD { + override fun loadComponent(name: String, commit: Long): String { + return grassFieldSvg.replace(NAME_FIX, name.toSvg(0.0, 3.0)) + .replace(COMMIT_FIX, commit.toSvg("commit", 260.0, 4.0)) + } + + override fun fillBackground(): String = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """.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 8d44e9c..cce1736 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/Svgs.kt @@ -12,6 +12,12 @@ val snowyFieldSvg: String = ClassPathResource("persona/field/snowy-field.svg") val carrotAndCoinSvg: String = ClassPathResource("persona/field/carrot-and-coin.svg") .getContentAsString(Charset.defaultCharset()) +val halloweenFieldSvg: String = ClassPathResource("persona/field/halloween-field.svg") + .getContentAsString(Charset.defaultCharset()) + +val grassFieldSvg: String = ClassPathResource("persona/field/grass-field.svg") + .getContentAsString(Charset.defaultCharset()) + val gooseSvg: String = ClassPathResource("persona/animal/goose.svg") .getContentAsString(Charset.defaultCharset()) diff --git a/src/main/resources/persona/field/grass-field.svg b/src/main/resources/persona/field/grass-field.svg new file mode 100644 index 0000000..4cf5285 --- /dev/null +++ b/src/main/resources/persona/field/grass-field.svg @@ -0,0 +1,10 @@ + + *{username} + + + + + + *{commit-count} + + diff --git a/src/main/resources/persona/field/halloween-field.svg b/src/main/resources/persona/field/halloween-field.svg new file mode 100644 index 0000000..4cf5285 --- /dev/null +++ b/src/main/resources/persona/field/halloween-field.svg @@ -0,0 +1,10 @@ + + *{username} + + + + + + *{commit-count} + +