summaryrefslogtreecommitdiffstats
path: root/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbattleship/kbattleship/kbdestroyshipstrategy.cpp')
-rw-r--r--kbattleship/kbattleship/kbdestroyshipstrategy.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
index 05095311..528d18b2 100644
--- a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
+++ b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
@@ -320,7 +320,7 @@ void KBDestroyShipStrategy::markBorderingFields()
if (m_direction == VERTICAL)
{
- while (m_fieldRect.tqcontains(col, row) &&
+ while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT)
{
row--;
@@ -332,24 +332,24 @@ void KBDestroyShipStrategy::markBorderingFields()
row++;
i = col+1; // right of the ship
j = col-1; // left of the ship
- while (m_fieldRect.tqcontains(col, row) &&
+ while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT)
{
- if (m_fieldRect.tqcontains(i, row))
+ if (m_fieldRect.contains(i, row))
setViablePos(i, row, false);
- if (m_fieldRect.tqcontains(j, row))
+ if (m_fieldRect.contains(j, row))
setViablePos(j, row, false);
setViablePos(col, row, false);
row++;
}
- if (m_fieldRect.tqcontains(col, row))
+ if (m_fieldRect.contains(col, row))
{ // below the ship
setViablePos(col, row, false);
}
}
else if (m_direction == HORIZONTAL)
{
- while (m_fieldRect.tqcontains(col, row) &&
+ while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT)
{
col--;
@@ -361,17 +361,17 @@ void KBDestroyShipStrategy::markBorderingFields()
col++;
i = row+1; // below the ship
j = row-1; // above the ship
- while (m_fieldRect.tqcontains(col, row) &&
+ while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT)
{
- if (m_fieldRect.tqcontains(col, i))
+ if (m_fieldRect.contains(col, i))
setViablePos(col, i, false);
- if (m_fieldRect.tqcontains(col, j))
+ if (m_fieldRect.contains(col, j))
setViablePos(col, j, false);
setViablePos(col, row, false);
col++;
}
- if (m_fieldRect.tqcontains(col, row))
+ if (m_fieldRect.contains(col, row))
{ // right of the ship
setViablePos(col, row, false);
}