3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __WORLDMAP_H__
13 #define __WORLDMAP_H__
15 #include "ivancommon.h"
26 typedef std::vector
<character
*> charactervector
;
29 typedef owterrain
*(*PlaceSpawner
) ();
32 struct WorldMapPlace
{
41 class worldmap
: public area
{
48 void Save (outputfile
&) const;
49 void Load (inputfile
&);
50 wsquare
*GetWSquare (v2 Pos
) const { return Map
[Pos
.X
][Pos
.Y
]; }
51 wsquare
*GetWSquare (int x
, int y
) const { return Map
[x
][y
]; }
52 void GenerateClimate ();
53 int WhatTerrainIsMostCommonAroundCurrentTerritorySquareIncludingTheSquareItself (int, int);
54 void CalculateContinents ();
55 void SmoothAltitude ();
56 void SmoothClimate ();
57 void RandomizeAltitude ();
58 continent
*GetContinentUnder (v2
) const;
59 continent
*GetContinent (int) const;
60 void RemoveEmptyContinents ();
62 charactervector
&GetPlayerGroup ();
63 character
*GetPlayerGroupMember (int);
64 virtual void Draw (truth
) const;
65 void CalculateLuminances ();
66 void CalculateNeighbourBitmapPoses ();
67 wsquare
*GetNeighbourWSquare (v2
, int) const;
68 v2
GetEntryPos (ccharacter
*, int) const;
69 void RevealEnvironment (v2
, int);
70 void SafeSmooth (int, int);
71 void FastSmooth (int, int);
72 wsquare
***GetMap () const { return Map
; }
75 static void RegisterPlace (owterrain
*, cint ttype
, cint didx
, PlaceSpawner aspawner
, truth aAllowSpawn
=true);
79 std::vector
<continent
*> Continent
;
81 uChar
**OldTypeBuffer
;
82 short **AltitudeBuffer
;
83 short **OldAltitudeBuffer
;
84 uChar
**ContinentBuffer
;
85 charactervector PlayerGroup
;
87 std::vector
<v2
> PlacePosition
;
88 std::vector
<truth
> PlaceRevealed
;
89 std::vector
<continent
*> PlaceContinent
;
91 static std::vector
<WorldMapPlace
> Places
;
94 outputfile
&operator << (outputfile
&, const worldmap
*);
95 inputfile
&operator >> (inputfile
&, worldmap
*&);