port/mars-tycoon
Last change
on this file was 80a6a52, checked in by Jonathan Neufeld <support@…>, 3 years ago |
Get to a compile state for terrain procedural generation
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[80a6a52] | 1 | #ifndef __GEOMORPH_H__
|
---|
| 2 | #define __GEOMORPH_H__
|
---|
| 3 |
|
---|
| 4 | #include <mars_util.h>
|
---|
| 5 | #include <mars_streams.h>
|
---|
| 6 | #include <typeinfo>
|
---|
| 7 |
|
---|
| 8 | #include "gwtypes.h"
|
---|
| 9 |
|
---|
| 10 | namespace geoworld
|
---|
| 11 | {
|
---|
| 12 | class GeoMorph
|
---|
| 13 | {
|
---|
| 14 | public:
|
---|
| 15 | // Called first to establish first state
|
---|
| 16 | virtual void init (SynthesisSession & manager, const IGeoWorldAccessor & accessor, const unsigned short nMaxWidth, const unsigned short nMaxHeight) = 0;
|
---|
| 17 |
|
---|
| 18 | inline std::string getTypeName () const
|
---|
| 19 | { return typeid(*this).name(); }
|
---|
| 20 | };
|
---|
| 21 |
|
---|
| 22 | class BoundedGeoMorph
|
---|
| 23 | {
|
---|
| 24 | public:
|
---|
| 25 | // Called to index this bounded morpho
|
---|
| 26 | virtual mars::BBox< long > getBBox () const = 0;
|
---|
| 27 | };
|
---|
| 28 |
|
---|
| 29 | class HeightMapGeoMorph : public GeoMorph
|
---|
| 30 | {
|
---|
| 31 | public:
|
---|
| 32 | // Called to perform CPU-intensive rasterization task
|
---|
| 33 | virtual void doMorph (LockedGWSection & section) const = 0;
|
---|
| 34 | };
|
---|
| 35 |
|
---|
| 36 | class PersistentGeoMorph
|
---|
| 37 | {
|
---|
| 38 | public:
|
---|
| 39 | class State
|
---|
| 40 | {
|
---|
| 41 | public:
|
---|
| 42 | virtual mars::ObjectStream & operator >> (mars::ObjectStream & outs) const = 0;
|
---|
| 43 | virtual mars::ObjectStream & operator << (mars::ObjectStream & ins) = 0;
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 | // Called by its factory to save/restore GeoMorph state
|
---|
| 47 | virtual mars::ptr< State > createState () const = 0;
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 | class MineralSpawnGeoMorph
|
---|
| 51 | {
|
---|
| 52 | public:
|
---|
| 53 | virtual void doSpawnMinerals (const IMineralQuery * pQMin, MineralsContainer & container) = 0;
|
---|
| 54 | };
|
---|
| 55 |
|
---|
| 56 | class MetaFieldSpawnGeoMorph
|
---|
| 57 | {
|
---|
| 58 | public:
|
---|
| 59 | virtual void getRequestedFields (std::set< FieldType > & setOut) const = 0;
|
---|
| 60 | //virtual void doPopulateMetaField (const FieldType enftFieldType)
|
---|
| 61 | };
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | #endif |
---|
Note:
See
TracBrowser
for help on using the repository browser.