TaskItemModelにフィールド追加
This commit is contained in:
parent
9ef445e9fc
commit
931786320d
|
@ -4,6 +4,9 @@ import android.graphics.Color;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import one.nem.kidshift.model.ChildModel;
|
||||||
import one.nem.kidshift.model.tasks.condition.TaskConditionBaseModel;
|
import one.nem.kidshift.model.tasks.condition.TaskConditionBaseModel;
|
||||||
|
|
||||||
public class TaskItemModel {
|
public class TaskItemModel {
|
||||||
|
@ -13,36 +16,41 @@ public class TaskItemModel {
|
||||||
private String iconEmoji; // Optional
|
private String iconEmoji; // Optional
|
||||||
private String bgColor; // Optional
|
private String bgColor; // Optional
|
||||||
private int reward;
|
private int reward;
|
||||||
|
private List<ChildModel> 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<ChildModel> attachedChildren) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.iconEmoji = iconEmoji;
|
this.iconEmoji = iconEmoji;
|
||||||
this.bgColor = bgColor;
|
this.bgColor = bgColor;
|
||||||
this.reward = reward;
|
this.reward = reward;
|
||||||
|
this.attachedChildren = attachedChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDなし (登録時など)
|
// IDなし (登録時など)
|
||||||
public TaskItemModel(String name, String iconEmoji, String bgColor, int reward) {
|
public TaskItemModel(String name, String iconEmoji, String bgColor, int reward, List<ChildModel> attachedChildren) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.iconEmoji = iconEmoji;
|
this.iconEmoji = iconEmoji;
|
||||||
this.bgColor = bgColor;
|
this.bgColor = bgColor;
|
||||||
this.reward = reward;
|
this.reward = reward;
|
||||||
|
this.attachedChildren = attachedChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optionalなフィールドなし
|
// Optionalなフィールドなし
|
||||||
public TaskItemModel(String id, String name, int reward) {
|
public TaskItemModel(String id, String name, int reward, List<ChildModel> attachedChildren) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.reward = reward;
|
this.reward = reward;
|
||||||
|
this.attachedChildren = attachedChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ID, Optionalなフィールドなし (登録時など)
|
// ID, Optionalなフィールドなし (登録時など)
|
||||||
public TaskItemModel(String name, int reward) {
|
public TaskItemModel(String name, int reward, List<ChildModel> attachedChildren) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.reward = reward;
|
this.reward = reward;
|
||||||
|
this.attachedChildren = attachedChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 空
|
// 空
|
||||||
|
@ -97,4 +105,12 @@ public class TaskItemModel {
|
||||||
public void setBgColorInt(int color) {
|
public void setBgColorInt(int color) {
|
||||||
this.bgColor = String.format("#%06X", 0xFFFFFF & color);
|
this.bgColor = String.format("#%06X", 0xFFFFFF & color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ChildModel> getAttachedChildren() {
|
||||||
|
return attachedChildren;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttachedChildren(List<ChildModel> attachedChildren) {
|
||||||
|
this.attachedChildren = attachedChildren;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user