This repository has been archived on 2026-10-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

27 lines
1.1 KiB
Go
Raw Permalink Normal View History

package models
import (
"encoding/json"
"sync"
)
var _ = json.RawMessage{}
var _ = sync.Mutex{}
//
// 搜打撤的格子占位模型 —— 逐条镜像客户端 LX6/Manager/ExtractionShooterUtils.lua 的
// OccupyCells / CheckCanAddItemByCell / TryGetFreeCellByOrder。
// 为什么必须镜像:客户端拖拽落地前会**自己**用这套规则校验一次(CheckShiftItemInBag、
// CheckCellAllowed、TryGetFreeCellIndexByConfigId),服务端如果只判"原点格空不空",
// 就会出现「2x3 的物品和 1 格的物品叠在一起」——因为 2x3 的覆盖区里那些非原点格在服务端看来是空的。
// 三条硬约束(照抄客户端,不要"优化"):
// 1. 坐标是 0 基,合法范围 x∈[0,sizeX-1]、y∈[0,sizeY-1]。
// 2. 物品占 Volume.x × Volume.y,IsRotated 时两者互换。
// 3. 找空格是 y 外层、x 内层(先铺满一行再换行),无旋转优先、旋转次之。
//
type ExtractionGrid4229938 struct {
Cells []bool `json:"_cells"`
SizeX int32 `json:"sizeX"`
SizeY int32 `json:"sizeY"`
}