Skip to content

Commit 0be8eea

Browse files
pizza6inchdada878
authored andcommitted
stage邏輯 概述
1 parent d701bf7 commit 0be8eea

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/app/api/stage/route.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ export const POST = async (request: NextRequest) => {
1616
const { row, column, layer } = position;
1717
// 使用 token 查詢對應stageID 的stage
1818
// 將blockId 放置在 row, column, layer 指定的位置
19-
// prisma query here
19+
// 判定玩家是否擁有該板塊 並且至少一塊
20+
// 判定是否有其他東西
21+
// 有則拒絕不給放
22+
// 沒有則玩家對應板塊的數量 - 1
23+
// 判定是否過關(isStageComplete())
24+
// 如果過關
25+
// 1.玩家point、score增加
26+
// 2.製造新的關卡 (根據size加倍)(createStage())
2027
// 將更新後的stageData 存入database
2128
// return 更新過後的stageData 給前端
2229
};
2330
// 錯誤情況1: 並非本次與會者invalid token
2431
// 錯誤情況2: 非法的blockId
2532
// 錯誤情況3: 非法的position
26-
// 錯誤情況4: 抓取資料問題
33+
// 錯誤情況4: 沒有該板塊
34+
// 錯誤情況5: 該位置上已有其他板塊 or 障礙物
35+
// 錯誤情況6: 其他錯誤

0 commit comments

Comments
 (0)