Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into feat/#165
Browse files Browse the repository at this point in the history
  • Loading branch information
moral-life committed Dec 1, 2024
2 parents 97c6b8e + 01de172 commit b17af7a
Show file tree
Hide file tree
Showing 33 changed files with 1,506 additions and 848 deletions.
88 changes: 76 additions & 12 deletions alsongDalsong/ASEntity/ASEntity/GameState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,53 +48,117 @@ public struct GameState {
if players.count <= 2, round == 1, recordOrder == 1 {
return .submitAnswer
}

if round == 1, recordOrder == players.count - 1 {
return .submitAnswer
}
else if round == 1, recordOrder >= 1 {
} else if round == 1, recordOrder >= 1 {
return .rehumming
}
case .result:
if players.count <= 2, recordOrder == 1 {
return .result
}

else if recordOrder == players.count - 1 {
else if recordOrder >= players.count - 1 {
return .result
}else {
} else {
return nil
}

default:
return .lobby
}
return nil
}

private func resolveHarmonyViewType(status: Status) -> GameViewType {
return .submitMusic
.submitMusic
}

private func resolveSyncViewType(status: Status) -> GameViewType {
return .submitMusic
.submitMusic
}

private func resolveInstantViewType(status: Status) -> GameViewType {
return .submitMusic
.submitMusic
}

private func resolveTTSViewType(status: Status) -> GameViewType {
return .submitMusic
.submitMusic
}
}


public enum GameViewType {
case submitMusic
case humming
case rehumming
case submitAnswer
case result
case lobby

public var title: String {
switch self {
case .submitMusic:
"노래 선택"
case .humming:
"허밍"
case .rehumming:
"리허밍"
case .submitAnswer:
"정답 맞추기"
case .result:
"게임 종료!"
case .lobby:
""
}
}

public var description: String {
switch self {
case .submitMusic:
"문제로 제출할 노래를 고르세요"
case .humming:
"다음 사람에게 고른 노래를 전달하세요"
case .rehumming:
"다음 사람에게 허밍을 전달하세요"
case .submitAnswer:
"허밍을 듣고 무슨 노래인지 맞춰 보세요."
case .result:
"결과 화면으로 이동합니다.."
case .lobby:
""
}
}

public var caution: String? {
switch self {
case .submitMusic:
nil
case .humming:
"가사나 제목을 직접적으로 전달하지 않도록 주의하세요"
case .rehumming:
"가사나 제목을 직접적으로 전달하지 않도록 주의하세요"
case .submitAnswer:
nil
case .result:
nil
case .lobby:
nil
}
}

public var symbol: (systemName: String, color: String)? {
switch self {
case .submitMusic:
(systemName: "music.note.list", color: "508DFD")
case .humming:
(systemName: "microphone", color: "FD5050")
case .rehumming:
(systemName: "microphone", color: "FD5050")
case .submitAnswer:
(systemName: "music.note.list", color: "508DFD")
case .result:
nil
case .lobby:
nil
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public protocol AvatarRepositoryProtocol {
func getAvatarData(url: URL) async -> Data?
}

public protocol RoomActionRepositoryProtocol {
public protocol RoomActionRepositoryProtocol: Sendable {
func createRoom(nickname: String, avatar: URL) async throws -> String
func joinRoom(nickname: String, avatar: URL, roomNumber: String) async throws -> Bool
func leaveRoom() async throws -> Bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.478",
"green" : "0.478",
"red" : "1.000"
"blue" : "0x52",
"green" : "0x52",
"red" : "0xF0"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.969",
"green" : "0.922",
"red" : "0.624"
"blue" : "0xD9",
"green" : "0xC5",
"red" : "0x46"
}
},
"idiom" : "universal"
Expand Down
Loading

0 comments on commit b17af7a

Please sign in to comment.