12 lines
976 B
Plaintext
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.
|