File indexing completed on 2024-04-28 07:54:19

0001 /* This file is part of KsirK.
0002    Copyright (C) 2008 Gael de Chalendar <kleag@free.fr>
0003 
0004    KsirK is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public
0006    License as published by the Free Software Foundation, either version 2
0007    of the License, or (at your option) any later version.
0008 
0009    This program is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    General Public License for more details.
0013 
0014    You should have received a copy of the GNU General Public License
0015    along with this program; if not, write to the Free Software
0016    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0017    02110-1301, USA
0018 */
0019 
0020 #include "ksirkcountrydefinition.h"
0021 #include "country.h"
0022 
0023 using namespace KsirkSkinEditor;
0024 
0025 KsirkCountryDefinitionWidget::KsirkCountryDefinitionWidget(QWidget* parent) : QDockWidget(parent)
0026 {
0027   setupUi(this);
0028 }
0029 
0030 void KsirkCountryDefinitionWidget::initWith(const Country* country)
0031 {
0032   flagx->setValue((country->pointFlag().x()));
0033   flagy->setValue(country->pointFlag().y());
0034   
0035   anchorx->setValue(country->anchorPoint().x());
0036   anchory->setValue(country->anchorPoint().y());
0037   
0038   centerx->setValue(country->centralPoint().x());
0039   centery->setValue(country->centralPoint().y());
0040   
0041   infantryx->setValue(country->pointInfantry().x());
0042   infantryy->setValue(country->pointInfantry().y());
0043   
0044   cavalryx->setValue(country->pointCavalry().x());
0045   cavalryy->setValue(country->pointCavalry().y());
0046   
0047   cannonx->setValue(country->pointCannon().x());
0048   cannony->setValue(country->pointCannon().y());
0049   
0050   anchorx->setValue(country->anchorPoint().x());
0051   anchory->setValue(country->anchorPoint().y());
0052   
0053   centerx->setValue(country->centralPoint().x());
0054   centery->setValue(country->centralPoint().y());
0055   
0056   neighbourslist->clear();
0057   foreach(Country* neighbour, country->neighbours())
0058   {
0059     neighbourslist->addItem(neighbour->name());
0060   }
0061 }