freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
worldmap.h
Go to the documentation of this file.
1  /* freg, Free-Roaming Elementary Game with open and interactive world
2  * Copyright (C) 2012-2014 Alexander 'mmaulwurff' Kromm
3  * mmaulwurff@gmail.com
4  *
5  * This file is part of FREG.
6  *
7  * FREG is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * FREG is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with FREG. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef WORLDMAP_H
21 #define WORLDMAP_H
22 
23 #include <QFile>
24 
25 class WorldMap final {
26 public:
27  explicit WorldMap(QString);
28 
29  WorldMap & operator=(const WorldMap &) = delete;
30  WorldMap(const WorldMap &) = delete;
31 
32  char TypeOfShred(long longi, long lati) const;
33  static void GenerateMap(
34  QString world_name,
35  int size,
36  char outer,
37  int seed);
38  long GetSpawnLongitude() const;
39  long GetSpawnLatitude() const;
40  static int GetSpawnCoordinate(int size);
41 
42 private:
43  static float Deg(int x, int y, int size);
44  static float R (int x, int y, int size);
45  static void Circle(int min_rad, int max_rad, char ch, int size, char* map);
46  static void PieceOfEden(int x, int y, char * map, size_t map_size);
47  static void MakeAndSaveSpawn(QString world_name, int size,
48  long * longitude, long * latitude);
49 
50  long mapSize;
51  mutable QFile map;
54 };
55 
56 #endif // WORLDMAP_H
long spawnLongitude
Definition: worldmap.h:52
static float Deg(int x, int y, int size)
Definition: worldmap.cpp:80
static void MakeAndSaveSpawn(QString world_name, int size, long *longitude, long *latitude)
Definition: worldmap.cpp:43
static void PieceOfEden(int x, int y, char *map, size_t map_size)
Definition: worldmap.cpp:183
WorldMap & operator=(const WorldMap &)=delete
long spawnLatitude
Definition: worldmap.h:53
long GetSpawnLongitude() const
Definition: worldmap.cpp:60
static void Circle(int min_rad, int max_rad, char ch, int size, char *map)
Definition: worldmap.cpp:104
long GetSpawnLatitude() const
Definition: worldmap.cpp:61
static void GenerateMap(QString world_name, int size, char outer, int seed)
Definition: worldmap.cpp:127
static float R(int x, int y, int size)
Definition: worldmap.cpp:100
char TypeOfShred(long longi, long lati) const
Definition: worldmap.cpp:63
WorldMap(QString)
Definition: worldmap.cpp:27
QFile map
Definition: worldmap.h:51
long mapSize
Definition: worldmap.h:50
static int GetSpawnCoordinate(int size)
Definition: worldmap.cpp:55