python-library-ff14-the-hunt 0.0.6__tar.gz → 0.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/.cursor/skills/ff14_the_hunt-package-preload/SKILL.md +25 -25
  2. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/PKG-INFO +1 -1
  3. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/README.md +2 -2
  4. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/enrich.py +7 -11
  5. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/spawn_points.py +8 -12
  6. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/ff14_the_hunt.py +1 -1
  7. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/cn.py +1 -1
  8. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/models.py +2 -2
  9. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/points.py +3 -5
  10. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/pyproject.toml +1 -1
  11. python_library_ff14_the_hunt-0.0.8/tests/test_recent_spawn_detection.py +59 -0
  12. python_library_ff14_the_hunt-0.0.8/tests/test_spawn_map_points.py +44 -0
  13. python_library_ff14_the_hunt-0.0.6/tests/test_spawn_map_points.py +0 -21
  14. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/.cursor/skills/ff14_the_hunt-package-changelog/SKILL.md +0 -0
  15. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/.cursor/skills/ff14_the_hunt-package-design/SKILL.md +0 -0
  16. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/.gitignore +0 -0
  17. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/example/__main__.py +0 -0
  18. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/example/spawn_map_io.py +0 -0
  19. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/example.bat +0 -0
  20. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/__init__.py +0 -0
  21. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/__init__.py +0 -0
  22. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/client.py +0 -0
  23. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/fate_timer.py +0 -0
  24. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/resources.py +0 -0
  25. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/spawn_window.py +0 -0
  26. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/bear_tracker/timer_theme.py +0 -0
  27. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/common/__init__.py +0 -0
  28. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/common/urlopen_retry.py +0 -0
  29. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/__init__.py +0 -0
  30. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/data/__init__.py +0 -0
  31. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/data/hunts_zh.json +0 -0
  32. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/data/regions_zh.json +0 -0
  33. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/detect.py +0 -0
  34. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/display.py +0 -0
  35. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/en.py +0 -0
  36. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/names.py +0 -0
  37. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/spawn_map_display.py +0 -0
  38. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/locale/tag.py +0 -0
  39. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/__init__.py +0 -0
  40. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/loop.py +0 -0
  41. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/monitor_mode.py +0 -0
  42. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/scheduler.py +0 -0
  43. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/sleep_plan.py +0 -0
  44. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/sleep_settings.py +0 -0
  45. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/spawn_dedup.py +0 -0
  46. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/poll/window_remaining.py +0 -0
  47. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/__init__.py +0 -0
  48. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/attach.py +0 -0
  49. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/coordinates.py +0 -0
  50. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/layout.py +0 -0
  51. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/png_meta.py +0 -0
  52. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/region_fetch.py +0 -0
  53. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/ff14_the_hunt/spawn_map/region_image.py +0 -0
  54. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/test.bat +0 -0
  55. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/__init__.py +0 -0
  56. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_fate_timer.py +0 -0
  57. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_ff14_the_hunt_service.py +0 -0
  58. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_locale_cn.py +0 -0
  59. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_monitor_mode.py +0 -0
  60. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_poll_scheduler.py +0 -0
  61. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_poll_sleep.py +0 -0
  62. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_spawn_dedup.py +0 -0
  63. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_spawn_map_data.py +0 -0
  64. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_spawn_window.py +0 -0
  65. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_untimed_marks_filter.py +0 -0
  66. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tests/test_urlopen_retry.py +0 -0
  67. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/tools/build_locale_data.py +0 -0
  68. {python_library_ff14_the_hunt-0.0.6 → python_library_ff14_the_hunt-0.0.8}/update.bat +0 -0
@@ -1,25 +1,25 @@
1
- ---
2
- name: ff14-the-hunt-package-preload
3
- description: ff14_the_hunt 包:会话预加载;改本包源码前 Read。
4
- ---
5
-
6
- # ff14_the_hunt · 会话预加载
7
-
8
- ## 初始化加载(Session preload)
9
-
10
- 在 **`packages/ff14_the_hunt/`** 下改源码、测试或 `pyproject.toml` 时,按序 **Read**:
11
-
12
- 1. `~/.cursor/skills/project-skill-manifest-policy/SKILL.md`
13
- 2. `~/.cursor/skills/forbidden-doc-comment-vocabulary/SKILL.md`
14
- 3. `~/.cursor/skills/markdown-authoring-zh/SKILL.md`
15
- 4. `~/.cursor/skills/python-project-ai/SKILL.md`
16
- 5. `~/.cursor/skills/python-doc-comments/SKILL.md`
17
- 6. `~/.cursor/skills/agent-codegen-self-review/SKILL.md`
18
- 7. `.cursor/skills/ff14_the_hunt-package-design/SKILL.md`
19
- 8. `.cursor/skills/ff14_the_hunt-package-changelog/SKILL.md`
20
-
21
- 整库约定见仓库根 `.cursor/skills/python-library-session-manifest/SKILL.md`。
22
-
23
- ## 用过的 skill(追加记录)
24
-
25
- (初始为空。)
1
+ ---
2
+ name: ff14-the-hunt-package-preload
3
+ description: ff14_the_hunt 包:会话预加载;改本包源码前 Read。
4
+ ---
5
+
6
+ # ff14_the_hunt · 会话预加载
7
+
8
+ ## 初始化加载(Session preload)
9
+
10
+ 在 **`packages/ff14_the_hunt/`** 下改源码、测试或 `pyproject.toml` 时,按序 **Read**:
11
+
12
+ 1. `~/.cursor/skills/project-skill-manifest-policy/SKILL.md`
13
+ 2. `~/.cursor/skills/forbidden-doc-comment-vocabulary/SKILL.md`
14
+ 3. `~/.cursor/skills/markdown-authoring-zh/SKILL.md`
15
+ 4. `~/.cursor/skills/python-project-ai/SKILL.md`
16
+ 5. `~/.cursor/skills/python-doc-comments/SKILL.md`
17
+ 6. `~/.cursor/skills/agent-codegen-self-review/SKILL.md`
18
+ 7. `.cursor/skills/ff14_the_hunt-package-design/SKILL.md`
19
+ 8. `.cursor/skills/ff14_the_hunt-package-changelog/SKILL.md`
20
+
21
+ 整库约定见仓库根 `.cursor/skills/python-library-session-manifest/SKILL.md`。
22
+
23
+ ## 用过的 skill(追加记录)
24
+
25
+ (初始为空。)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-library-ff14-the-hunt
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: pydantic>=2.0
6
6
  Provides-Extra: dev
@@ -66,9 +66,9 @@ example.bat
66
66
  | --- | --- |
67
67
  | `POST /api/syncSession` | 狩猎库、刷点坐标、数据中心/世界列表 |
68
68
  | `POST /api/lastDeathTimers` | 计时行;`RankType` 为 `aRank` / `sRank` / `fate` |
69
- | `POST /api/querySpawnPoints` | 刚刷新记录的各刷点存活状态(需 `LastDeath`) |
69
+ | `POST /api/querySpawnPoints` | 刚刷新记录的非触发点认证状态(需 `LastDeath`) |
70
70
 
71
- 刚刷新记录才填充 ``spawn_points``、``spawn_map_layout`` 与 ``region_map``。包内不标点、不裁剪;``region_map`` 为站点 ``HuntRegions`` 原图 base64。刷点含 ``地图X/Y``、``格点X/Y``、``像素X/Y``(按原图尺寸算好);``地图布局`` 含格点尺度与归一化公式。默认 ``include_spawn_maps=True`` 拉取原图。示例 ``python -m example`` 将 PNG 写入 ``example/output/maps/``,JSON 用 ``区域地图.地图文件`` 引用。
71
+ 刚刷新记录才填充 ``spawn_points``、``spawn_map_layout`` 与 ``region_map``。包内不标点、不裁剪;``region_map`` 为站点 ``HuntRegions`` 原图 base64。刷点仅保留未被 Sonar 或玩家认证为非触发的绿色候选点,含 ``地图X/Y``、``格点X/Y``、``像素X/Y``(按原图尺寸算好);``地图布局`` 含格点尺度与归一化公式。默认 ``include_spawn_maps=True`` 拉取原图。示例 ``python -m example`` 将 PNG 写入 ``example/output/maps/``,JSON 用 ``区域地图.地图文件`` 引用。
72
72
 
73
73
  `QueryDeathTimers` 为世界名列表(由所选数据中心展开)。
74
74
 
@@ -7,10 +7,9 @@ from ff14_the_hunt.models import HuntMarkRecord, HuntQueryFilter
7
7
 
8
8
  from ff14_the_hunt.bear_tracker.fate_timer import compute_fate_timer
9
9
  from ff14_the_hunt.bear_tracker.resources import BearResources
10
- from ff14_the_hunt.bear_tracker.spawn_window import (
11
- compute_trigger_timer,
12
- is_recently_in_window,
13
- )
10
+ from ff14_the_hunt.bear_tracker.spawn_window import (
11
+ compute_trigger_timer,
12
+ )
14
13
 
15
14
 
16
15
  def mark_has_display_timer(record: HuntMarkRecord) -> bool:
@@ -88,13 +87,10 @@ def build_hunt_record(
88
87
  now=now,
89
88
  )
90
89
 
91
- recently = is_recently_in_window(trigger, grace_seconds=recent_grace_seconds)
92
- if last_mark and now is not None:
93
- if now - float(last_mark) <= recent_grace_seconds:
94
- recently = True
95
- elif last_mark:
96
- if time.time() - float(last_mark) <= recent_grace_seconds:
97
- recently = True
90
+ recently = False
91
+ if last_mark:
92
+ reference_now = time.time() if now is None else now
93
+ recently = reference_now - float(last_mark) <= recent_grace_seconds
98
94
 
99
95
  region = meta.get("Region", "")
100
96
  return HuntMarkRecord(
@@ -40,21 +40,17 @@ def list_map_coordinates(
40
40
  grid_y = float(raw[1])
41
41
  norm_x = (grid_x - 1.0) / scale
42
42
  norm_y = (grid_y - 1.0) / scale
43
- state = None
44
- if api_states and key in api_states:
45
- entry = api_states[key]
46
- if isinstance(entry, dict):
47
- state_val = entry.get("State")
48
- if state_val is not None:
49
- state = bool(state_val)
43
+ state = None
44
+ if api_states is not None:
45
+ state = key not in api_states
50
46
  coordinates.append(
51
47
  MapCoordinate(
52
48
  point_key=key,
53
49
  x=norm_x,
54
50
  y=norm_y,
55
- grid_x=grid_x,
56
- grid_y=grid_y,
57
- active=state,
58
- )
59
- )
51
+ grid_x=grid_x,
52
+ grid_y=grid_y,
53
+ active=state,
54
+ )
55
+ )
60
56
  return coordinates
@@ -67,7 +67,7 @@ class FF14TheHunt:
67
67
  min_wakeup_seconds: 全未开窗时睡到最近开窗的下限(秒),默认 2 分钟。
68
68
  poll_interval_seconds: 已废弃;等同 ``fallback_poll_interval_seconds``。
69
69
  recent_grace_seconds: 「刚刷新」宽限秒数。
70
- include_spawn_states: 已废弃;刚刷新记录的存活点会在补全刷点时自动查询。
70
+ include_spawn_states: 已废弃;刚刷新记录的候选点会在补全刷点时自动查询。
71
71
  include_spawn_maps: 为刚刷新记录拉取站点区域原图 PNG base64。
72
72
  include_untimed_marks: 是否保留无计时的占位行(SS 级噬灵王、维护占位等)。
73
73
  """
@@ -152,7 +152,7 @@ def mark_to_display_dict(
152
152
  "像素Y": point.pixel_y,
153
153
  "格点X": point.grid_x,
154
154
  "格点Y": point.grid_y,
155
- "存活": point.active,
155
+ "可能触发": point.active,
156
156
  }
157
157
  for point in mark.spawn_points
158
158
  ]
@@ -58,7 +58,7 @@ class MapCoordinate(BaseModel):
58
58
  default=None,
59
59
  description="区域原图上的 Y 像素;norm_y * 图高",
60
60
  )
61
- active: bool | None = Field(default=None, description="querySpawnPoints 返回的存活点位状态")
61
+ active: bool | None = Field(default=None, description="是否仍是可能触发点位")
62
62
 
63
63
 
64
64
  class SpawnMapLayout(BaseModel):
@@ -127,7 +127,7 @@ class HuntMarkRecord(BaseModel):
127
127
  fate_timer: TimerDisplay | None = None
128
128
  spawn_points: list[MapCoordinate] = Field(
129
129
  default_factory=list,
130
- description="仅刚刷新记录填充;有存活点时只保留存活点",
130
+ description="仅刚刷新记录填充;只保留可能触发点位",
131
131
  )
132
132
  spawn_map_layout: SpawnMapLayout | None = Field(
133
133
  default=None,
@@ -3,12 +3,10 @@ from __future__ import annotations
3
3
  from ff14_the_hunt.models import MapCoordinate
4
4
 
5
5
 
6
- def select_display_spawn_points(points: list[MapCoordinate]) -> list[MapCoordinate]:
7
- """刚刷新记录上要展示的刷点;有存活点时只保留存活点。"""
6
+ def select_display_spawn_points(points: list[MapCoordinate]) -> list[MapCoordinate]:
7
+ """刚刷新记录上只展示仍可能触发的绿色候选点。"""
8
8
  active = [point for point in points if point.active is True]
9
- if active:
10
- return active
11
- return list(points)
9
+ return active
12
10
 
13
11
 
14
12
  def resolve_region_name(region: str | list[str]) -> str:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-library-ff14-the-hunt"
7
- version = "0.0.6"
7
+ version = "0.0.8"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
10
  "pydantic>=2.0",
@@ -0,0 +1,59 @@
1
+ from ff14_the_hunt.bear_tracker.enrich import build_hunt_record
2
+ from ff14_the_hunt.bear_tracker.resources import BearResources
3
+ from ff14_the_hunt.models import HuntQueryFilter
4
+
5
+
6
+ _RESOURCES = BearResources(
7
+ {
8
+ "DatabaseHunt": {
9
+ "Sansheya": {
10
+ "Patch": "DT",
11
+ "Region": "Shaaloani",
12
+ "Rank": 3,
13
+ "RespawnTimer": [46.0, 2.0],
14
+ },
15
+ },
16
+ "SpawnPoint": {},
17
+ "DataCenters": {},
18
+ },
19
+ )
20
+
21
+
22
+ def _row(**overrides) -> dict:
23
+ row = {
24
+ "huntKey": "Sansheya",
25
+ "huntName": "Sansheya",
26
+ "worldName": "Test",
27
+ "isMaint": False,
28
+ "lastDeathTime": 1_000_000.0,
29
+ }
30
+ row.update(overrides)
31
+ return row
32
+
33
+
34
+ def test_open_window_without_last_mark_is_not_recently_spawned() -> None:
35
+ record = build_hunt_record(
36
+ timer_row=_row(),
37
+ resources=_RESOURCES,
38
+ query=HuntQueryFilter(),
39
+ now=1_000_000.0 + 46 * 3600 + 60,
40
+ recent_grace_seconds=900.0,
41
+ )
42
+
43
+ assert record is not None
44
+ assert record.trigger_timer is not None
45
+ assert record.recently_spawned is False
46
+
47
+
48
+ def test_recent_last_mark_is_recently_spawned() -> None:
49
+ now = 1_000_000.0 + 46 * 3600 + 60
50
+ record = build_hunt_record(
51
+ timer_row=_row(lastMarkTime=now - 30),
52
+ resources=_RESOURCES,
53
+ query=HuntQueryFilter(),
54
+ now=now,
55
+ recent_grace_seconds=900.0,
56
+ )
57
+
58
+ assert record is not None
59
+ assert record.recently_spawned is True
@@ -0,0 +1,44 @@
1
+ from ff14_the_hunt.models import MapCoordinate
2
+ from ff14_the_hunt.bear_tracker.spawn_points import list_map_coordinates
3
+ from ff14_the_hunt.spawn_map.points import select_display_spawn_points
4
+
5
+
6
+ def test_select_display_spawn_points_keeps_only_possible_points() -> None:
7
+ points = [
8
+ MapCoordinate(point_key="SpawnPoint01", x=0.1, y=0.2, active=False),
9
+ MapCoordinate(point_key="SpawnPoint02", x=0.3, y=0.4, active=True),
10
+ ]
11
+ selected = select_display_spawn_points(points)
12
+ assert len(selected) == 1
13
+ assert selected[0].point_key == "SpawnPoint02"
14
+
15
+
16
+ def test_select_display_spawn_points_does_not_fallback_to_excluded_points() -> None:
17
+ points = [
18
+ MapCoordinate(point_key="SpawnPoint01", x=0.1, y=0.2, active=None),
19
+ MapCoordinate(point_key="SpawnPoint02", x=0.3, y=0.4, active=False),
20
+ ]
21
+ selected = select_display_spawn_points(points)
22
+ assert selected == []
23
+
24
+
25
+ def test_list_map_coordinates_marks_unreported_points_as_possible() -> None:
26
+ points = list_map_coordinates(
27
+ {
28
+ "Dimensions": [41, 41],
29
+ "DisplayPoints": 3,
30
+ "SpawnPoint01": [1, 1],
31
+ "SpawnPoint02": [2, 2],
32
+ "SpawnPoint03": [3, 3],
33
+ },
34
+ api_states={
35
+ "SpawnPoint01": {"State": True, "Verified": True},
36
+ "SpawnPoint02": {"State": False, "Verified": True},
37
+ },
38
+ )
39
+
40
+ assert [(point.point_key, point.active) for point in points] == [
41
+ ("SpawnPoint01", False),
42
+ ("SpawnPoint02", False),
43
+ ("SpawnPoint03", True),
44
+ ]
@@ -1,21 +0,0 @@
1
- from ff14_the_hunt.models import MapCoordinate
2
- from ff14_the_hunt.spawn_map.points import select_display_spawn_points
3
-
4
-
5
- def test_select_display_spawn_points_prefers_active() -> None:
6
- points = [
7
- MapCoordinate(point_key="SpawnPoint01", x=0.1, y=0.2, active=False),
8
- MapCoordinate(point_key="SpawnPoint02", x=0.3, y=0.4, active=True),
9
- ]
10
- selected = select_display_spawn_points(points)
11
- assert len(selected) == 1
12
- assert selected[0].point_key == "SpawnPoint02"
13
-
14
-
15
- def test_select_display_spawn_points_keeps_all_when_no_active() -> None:
16
- points = [
17
- MapCoordinate(point_key="SpawnPoint01", x=0.1, y=0.2, active=None),
18
- MapCoordinate(point_key="SpawnPoint02", x=0.3, y=0.4, active=False),
19
- ]
20
- selected = select_display_spawn_points(points)
21
- assert len(selected) == 2