| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | #include "displayboard.h"cxx . . $ `<file>/src/displayboard.h`/ |
| 24 | #include "stone.h"cxx . . $ `<file>/src/board/stone.h`/ |
| 25 | #include "mark.h"cxx . . $ `<file>/src/board/mark.h`/ |
| 26 | #include "board.h"cxx . . $ `<file>/src/board/board.h`/ |
| 27 | #include "imagehandler.h"cxx . . $ `<file>/src/board/imagehandler.h`/ |
| 28 | |
| 29 | #include <QtWidgets> |
| 30 | |
| 31 | DisplayBoardcxx . . $ DisplayBoard#::DisplayBoardcxx . . $ DisplayBoard#DisplayBoard(569870a2e0b0fd5d).(QWidgetcxx . . $ QWidget# *parent, QGraphicsScenecxx . . $ QGraphicsScene# *c) |
| 32 | : Boardcxx . . $ Board#(parent,c) |
| 33 | { |
| 34 | isDisplayBoardcxx . . $ Board#isDisplayBoard. = true; |
| 35 | showCoordscxx . . $ Board#showCoords. = false; |
| 36 | imageHandlercxx . . $ Board#imageHandler.->setDisplaycxx . . $ ImageHandler#setDisplay(b45ddcbc8423892c).(true); |
| 37 | } |
| 38 | |
| 39 | DisplayBoardcxx . . $ DisplayBoard#::~cxx . . $ DisplayBoard#`~DisplayBoard`(ced63f7c635d850d).DisplayBoardcxx . . $ DisplayBoard#() |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | /* Used by file browse display */ |
| 44 | void DisplayBoardcxx . . $ DisplayBoard#::displayHandicapcxx . . $ DisplayBoard#displayHandicap(d4f767463ce0a6b3).(int handicap) |
| 45 | { |
| 46 | int size = 19; |
| 47 | int edge_dist = (size > 12 ? 4 : 3); |
| 48 | int low = edge_dist; |
| 49 | int middle = (size + 1) / 2; |
| 50 | int high = size + 1 - edge_dist; |
| 51 | |
| 52 | |
| 53 | switch (handicap) |
| 54 | { |
| 55 | case 9: |
| 56 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., middle, middle); |
| 57 | case 8: |
| 58 | case 7: |
| 59 | if (handicap >= 8) |
| 60 | { |
| 61 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., middle, low); |
| 62 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., middle, high); |
| 63 | } |
| 64 | else |
| 65 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., middle, middle); |
| 66 | case 6: |
| 67 | case 5: |
| 68 | if (handicap >= 6) |
| 69 | { |
| 70 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., low, middle); |
| 71 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., high, middle); |
| 72 | } |
| 73 | else |
| 74 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., middle, middle); |
| 75 | case 4: |
| 76 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., high, high); |
| 77 | case 3: |
| 78 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., low, low); |
| 79 | case 2: |
| 80 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., high, low); |
| 81 | updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack., low, high); |
| 82 | default: |
| 83 | break; |
| 84 | } |
| 85 | |
| 86 | |
| 87 | } |
| 88 |