Skip to content

Commit 5e801f9

Browse files
committed
[feat] 퀘스트와 유저 엔티티 추가
1 parent b201259 commit 5e801f9

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

DailyQuest/DailyQuest.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
34131399291E47D300E607E1 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 34131398291E47D300E607E1 /* RxSwift */; };
1212
3413139C291E480500E607E1 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3413139B291E480500E607E1 /* SnapKit */; };
1313
3413139F291E48A100E607E1 /* Realm in Frameworks */ = {isa = PBXBuildFile; productRef = 3413139E291E48A100E607E1 /* Realm */; };
14+
3449AD5B2922164B00B87619 /* Quest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3449AD5A2922164B00B87619 /* Quest.swift */; };
15+
3449AD5D2922197000B87619 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3449AD5C2922197000B87619 /* User.swift */; };
1416
34ACC32D291DE9C000741371 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34ACC32C291DE9C000741371 /* AppDelegate.swift */; };
1517
34ACC32F291DE9C000741371 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34ACC32E291DE9C000741371 /* SceneDelegate.swift */; };
1618
34ACC336291DE9C100741371 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34ACC335291DE9C100741371 /* Assets.xcassets */; };
@@ -43,6 +45,8 @@
4345
/* End PBXContainerItemProxy section */
4446

4547
/* Begin PBXFileReference section */
48+
3449AD5A2922164B00B87619 /* Quest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Quest.swift; sourceTree = "<group>"; };
49+
3449AD5C2922197000B87619 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
4650
34ACC329291DE9C000741371 /* DailyQuest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DailyQuest.app; sourceTree = BUILT_PRODUCTS_DIR; };
4751
34ACC32C291DE9C000741371 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4852
34ACC32E291DE9C000741371 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
@@ -90,6 +94,22 @@
9094
/* End PBXFrameworksBuildPhase section */
9195

9296
/* Begin PBXGroup section */
97+
3449AD592922162E00B87619 /* Entities */ = {
98+
isa = PBXGroup;
99+
children = (
100+
3449AD5A2922164B00B87619 /* Quest.swift */,
101+
3449AD5C2922197000B87619 /* User.swift */,
102+
);
103+
path = Entities;
104+
sourceTree = "<group>";
105+
};
106+
3449AD5E292219D600B87619 /* Common */ = {
107+
isa = PBXGroup;
108+
children = (
109+
);
110+
path = Common;
111+
sourceTree = "<group>";
112+
};
93113
34ACC320291DE9C000741371 = {
94114
isa = PBXGroup;
95115
children = (
@@ -154,13 +174,15 @@
154174
34ACC368291DF02500741371 /* Presentaion */ = {
155175
isa = PBXGroup;
156176
children = (
177+
3449AD5E292219D600B87619 /* Common */,
157178
);
158179
path = Presentaion;
159180
sourceTree = "<group>";
160181
};
161182
34ACC369291DF03600741371 /* Domain */ = {
162183
isa = PBXGroup;
163184
children = (
185+
3449AD592922162E00B87619 /* Entities */,
164186
);
165187
path = Domain;
166188
sourceTree = "<group>";
@@ -319,7 +341,9 @@
319341
isa = PBXSourcesBuildPhase;
320342
buildActionMask = 2147483647;
321343
files = (
344+
3449AD5D2922197000B87619 /* User.swift in Sources */,
322345
34ACC32D291DE9C000741371 /* AppDelegate.swift in Sources */,
346+
3449AD5B2922164B00B87619 /* Quest.swift in Sources */,
323347
34ACC32F291DE9C000741371 /* SceneDelegate.swift in Sources */,
324348
);
325349
runOnlyForDeploymentPostprocessing = 0;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Quest.swift
3+
// DailyQuest
4+
//
5+
// Created by jinwoong Kim on 2022/11/14.
6+
//
7+
8+
import Foundation
9+
10+
struct Quest {
11+
let title: String
12+
let startDay: Date
13+
let endDay: Date
14+
let `repeat`: Int
15+
var currentCount: Int
16+
let totalCount: Int
17+
18+
var state: Bool {
19+
return currentCount == totalCount
20+
}
21+
22+
mutating func increaseCount(with value: Int=1) {
23+
guard currentCount + value <= totalCount else {
24+
self.currentCount = totalCount
25+
return
26+
}
27+
self.currentCount += value
28+
}
29+
30+
mutating func decreaseCount(with value: Int=1) {
31+
guard currentCount - value >= 0 else {
32+
self.currentCount = 0
33+
return
34+
}
35+
self.currentCount -= value
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// User.swift
3+
// DailyQuest
4+
//
5+
// Created by jinwoong Kim on 2022/11/14.
6+
//
7+
8+
import Foundation
9+
10+
struct User {
11+
let uuid: UUID
12+
let nickName: String
13+
let profile: Data
14+
let backgroundImage: Data
15+
let description: String
16+
}

0 commit comments

Comments
 (0)