MCPcopy Create free account
hub / github.com/Loping151/RoverSign / SignStatus

Class SignStatus

RoverSign/utils/database/states.py:6–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6class SignStatus(int):
7 GAME_SIGN = 1 # 游戏签到(鸣潮)
8 PGR_GAME_SIGN = 1 # 游戏签到(战双)
9 BBS_SIGN = 1 # 社区签到
10 BBS_DETAIL = 3 # 社区浏览
11 BBS_LIKE = 5 # 社区点赞
12 BBS_SHARE = 1 # 社区分享
13
14 @classmethod
15 def waves_game_sign_complete(cls, rover_sign: RoverSign):
16 return cls.GAME_SIGN == rover_sign.game_sign
17
18 @classmethod
19 def pgr_game_sign_complete(cls, rover_sign: RoverSign):
20 return cls.PGR_GAME_SIGN == rover_sign.pgr_game_sign
21
22 @classmethod
23 def game_sign_complete(cls, rover_sign: RoverSign):
24 """向后兼容的方法"""
25 return cls.waves_game_sign_complete(rover_sign)
26
27 @classmethod
28 def bbs_sign_complete(
29 cls, rover_sign: RoverSign, tasks: Optional[Iterable[str]] = None
30 ):
31 task_set = set(tasks) if tasks is not None else {
32 "bbs_sign",
33 "bbs_detail",
34 "bbs_like",
35 "bbs_share",
36 }
37
38 if "bbs_sign" in task_set and cls.BBS_SIGN != rover_sign.bbs_sign:
39 return False
40 if "bbs_detail" in task_set and cls.BBS_DETAIL != rover_sign.bbs_detail:
41 return False
42 if "bbs_like" in task_set and cls.BBS_LIKE != rover_sign.bbs_like:
43 return False
44 if "bbs_share" in task_set and cls.BBS_SHARE != rover_sign.bbs_share:
45 return False
46
47 return True

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected