From 790b3a1c4283c198c4fca29aef899ff8371d78d2 Mon Sep 17 00:00:00 2001 From: devxb Date: Fri, 17 May 2024 23:08:20 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=8E=AB=EC=9D=B4=2030=EB=A7=88?= =?UTF-8?q?=EB=A6=AC=20=EC=9D=BC=EB=95=8C=20visible=EC=9D=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=EB=A5=BC=20=EC=88=98=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/org/gitanimals/render/domain/User.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/gitanimals/render/domain/User.kt b/src/main/kotlin/org/gitanimals/render/domain/User.kt index d5a2ac6..338a1a8 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/User.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/User.kt @@ -88,13 +88,14 @@ class User( val persona = personas.find { it.id == personaId } ?: throw IllegalArgumentException("Cannot find persona by id \"$personaId\"") + persona.visible = visible + val visiblePersonas = personas.filter { it.visible } require(visiblePersonas.size < MAX_PERSONA_COUNT) { "Persona count must be under \"$MAX_PERSONA_COUNT\" but, current persona count is \"${visiblePersonas.size}\"" } - persona.visible = visible return persona }