From 931786320ddf13de95022ccfec7d3384e882f5b1 Mon Sep 17 00:00:00 2001 From: rca Date: Sat, 29 Jun 2024 11:27:46 +0900 Subject: [PATCH] =?UTF-8?q?TaskItemModel=E3=81=AB=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kidshift/model/tasks/TaskItemModel.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/model/src/main/java/one/nem/kidshift/model/tasks/TaskItemModel.java b/model/src/main/java/one/nem/kidshift/model/tasks/TaskItemModel.java index 6308b37..3c7536a 100644 --- a/model/src/main/java/one/nem/kidshift/model/tasks/TaskItemModel.java +++ b/model/src/main/java/one/nem/kidshift/model/tasks/TaskItemModel.java @@ -4,6 +4,9 @@ import android.graphics.Color; import androidx.annotation.NonNull; +import java.util.List; + +import one.nem.kidshift.model.ChildModel; import one.nem.kidshift.model.tasks.condition.TaskConditionBaseModel; public class TaskItemModel { @@ -13,36 +16,41 @@ public class TaskItemModel { private String iconEmoji; // Optional private String bgColor; // Optional private int reward; + private List attachedChildren; // Optional // コンストラクタ // 全プロパティ - public TaskItemModel(String id, String name, String iconEmoji, String bgColor, int reward) { + public TaskItemModel(String id, String name, String iconEmoji, String bgColor, int reward, List attachedChildren) { this.id = id; this.name = name; this.iconEmoji = iconEmoji; this.bgColor = bgColor; this.reward = reward; + this.attachedChildren = attachedChildren; } // IDなし (登録時など) - public TaskItemModel(String name, String iconEmoji, String bgColor, int reward) { + public TaskItemModel(String name, String iconEmoji, String bgColor, int reward, List attachedChildren) { this.name = name; this.iconEmoji = iconEmoji; this.bgColor = bgColor; this.reward = reward; + this.attachedChildren = attachedChildren; } // Optionalなフィールドなし - public TaskItemModel(String id, String name, int reward) { + public TaskItemModel(String id, String name, int reward, List attachedChildren) { this.id = id; this.name = name; this.reward = reward; + this.attachedChildren = attachedChildren; } // ID, Optionalなフィールドなし (登録時など) - public TaskItemModel(String name, int reward) { + public TaskItemModel(String name, int reward, List attachedChildren) { this.name = name; this.reward = reward; + this.attachedChildren = attachedChildren; } // 空 @@ -97,4 +105,12 @@ public class TaskItemModel { public void setBgColorInt(int color) { this.bgColor = String.format("#%06X", 0xFFFFFF & color); } + + public List getAttachedChildren() { + return attachedChildren; + } + + public void setAttachedChildren(List attachedChildren) { + this.attachedChildren = attachedChildren; + } }