Files
DFJ/tasks/task_007.txt
2025-12-16 08:57:19 +08:00

12 lines
976 B
Plaintext

# Task ID: 7
# Title: Plane Model & Collision Detection Logic
# Status: pending
# Dependencies: 1, 6
# Priority: high
# Description: Implement the plane data structure (head, wings, body, tail) and the logic for checking placement legality, including boundary checks, no overlap, and completeness. This logic will be shared between client-side UI feedback and server-side validation.
# Details:
Define a plane object with its shape (array of relative coordinates from head), orientation, and position. Implement a `checkPlacementLegality(board, plane)` function that verifies all constraints: 10x10 boundary, no overlap with other planes, and all plane parts are within bounds. This logic should be robust and reusable.
# Test Strategy:
Write comprehensive unit tests for `checkPlacementLegality` covering valid placements, invalid placements (out of bounds, overlapping, incomplete), and different plane orientations. Test performance of the algorithm with multiple planes.