File indexing completed on 2024-04-21 04:03:07

0001 /***************************************************************************
0002                                cmapdata.cpp
0003                              -------------------
0004     begin                : Sat Mar 10 2001
0005     copyright            : (C) 2001 by Kmud Developer Team
0006     email                : kmud-devel@kmud.de
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #include "cmapdata.h"
0019 
0020 #include <QFontDatabase>
0021 
0022 #include "cmaplevel.h"
0023 
0024 CMapData::CMapData()
0025 {
0026     gridSize.setWidth(20);
0027     gridSize.setHeight(20);
0028 
0029     // FIXME_jp: This needs loading/saving
0030     defaultPathTwoWay = true;
0031     showUpperLevel = true;
0032     showLowerLevel = true;
0033     gridVisable = true;
0034 
0035     speedwalkAbortActive = false;
0036     speedwalkAbortLimit = 100;
0037     speedwalkDelay = 5;
0038 
0039     validRoomCheck = false;
0040 
0041     defaultTextColor = Qt::black;
0042     defaultTextFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
0043 
0044     failedMoveMsg.clear();
0045 
0046     rootZone = nullptr;
0047     
0048     //initDirections();
0049 }
0050 
0051 CMapData::~CMapData()
0052 {
0053 }
0054 
0055 void CMapData::initDirections(void)
0056 {
0057     directions[NORTH]     = "north";
0058     directions[SOUTH]     = "south";
0059     directions[WEST]      = "west";
0060     directions[EAST]      = "east";
0061     directions[NORTHWEST] = "northwest";
0062     directions[NORTHEAST] = "northeast";
0063     directions[SOUTHWEST] = "southwest";
0064     directions[SOUTHEAST] = "southeast";
0065     directions[UP]        = "up";
0066     directions[DOWN]      = "down";
0067 
0068     directions[NORTH+(NUM_DIRECTIONS/2)]     = "n";
0069     directions[SOUTH+(NUM_DIRECTIONS/2)]     = "s";
0070     directions[WEST+(NUM_DIRECTIONS/2)]      = "w";
0071     directions[EAST+(NUM_DIRECTIONS/2)]      = "e";
0072     directions[NORTHWEST+(NUM_DIRECTIONS/2)] = "nw";
0073     directions[NORTHEAST+(NUM_DIRECTIONS/2)] = "ne";
0074     directions[SOUTHWEST+(NUM_DIRECTIONS/2)] = "sw";
0075     directions[SOUTHEAST+(NUM_DIRECTIONS/2)] = "se";
0076     directions[UP+(NUM_DIRECTIONS/2)]        = "u";
0077     directions[DOWN+(NUM_DIRECTIONS/2)]      = "d";
0078 
0079 }
0080 
0081