card dragging
This commit is contained in:
@@ -277,13 +277,16 @@ namespace Puzzle
|
||||
bx::snprintf(buf, bufSize, "%s/%u.pzl", Puzzle::PuzzleFileDir, puzID);
|
||||
}
|
||||
|
||||
// TODO: targetPos is of type CardPos
|
||||
bool ReturnPlacedCard(PuzzleData& obj, PuzPos targetPos)
|
||||
{
|
||||
auto& placedCard = obj.PlacedCards[targetPos.Y * Config::MaxPuzzleSizeCards + targetPos.X];
|
||||
if (IsValid(placedCard.RefCard))
|
||||
{
|
||||
if (placedCard.IsLocked) return false;
|
||||
if (placedCard.IsLocked)
|
||||
{
|
||||
LOG_WARN("Card at %i %i is locked!", targetPos.X, targetPos.Y);
|
||||
return false;
|
||||
}
|
||||
bool found = false;
|
||||
for (int32_t i = 0; i < obj.AvailableCardCount; ++i)
|
||||
{
|
||||
@@ -304,7 +307,6 @@ namespace Puzzle
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: targetPos is of type CardPos
|
||||
bool DragAvailableCardTo(PuzzleData& obj, PuzPos targetPos, int32_t availIdx, uint8_t rotation)
|
||||
{
|
||||
if (availIdx >= obj.AvailableCardCount)
|
||||
|
||||
Reference in New Issue
Block a user