Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarTileModification.hpp
blob: bd30386912057d3a414a2f7466913770fd8b1b45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef STAR_TILE_MODIFICATION_HPP
#define STAR_TILE_MODIFICATION_HPP

#include "StarDataStream.hpp"
#include "StarVariant.hpp"
#include "StarGameTypes.hpp"

namespace Star {

struct PlaceMaterial {
  TileLayer layer;
  MaterialId material;

  // If the material hue shift is not set it will get the natural hue shift for
  // the environment.
  Maybe<MaterialHue> materialHueShift;
};
DataStream& operator>>(DataStream& ds, PlaceMaterial& tileMaterialPlacement);
DataStream& operator<<(DataStream& ds, PlaceMaterial const& tileMaterialPlacement);

struct PlaceMod {
  TileLayer layer;
  ModId mod;

  // If the mod hue shift is not set it will get the natural hue shift for the
  // environment.
  Maybe<MaterialHue> modHueShift;
};
DataStream& operator>>(DataStream& ds, PlaceMod& tileModPlacement);
DataStream& operator<<(DataStream& ds, PlaceMod const& tileModPlacement);

struct PlaceMaterialColor {
  TileLayer layer;
  MaterialColorVariant color;
};
DataStream& operator>>(DataStream& ds, PlaceMaterialColor& tileMaterialColorPlacement);
DataStream& operator<<(DataStream& ds, PlaceMaterialColor const& tileMaterialColorPlacement);

struct PlaceLiquid {
  LiquidId liquid;
  float liquidLevel;
};
DataStream& operator>>(DataStream& ds, PlaceLiquid& tileLiquidPlacement);
DataStream& operator<<(DataStream& ds, PlaceLiquid const& tileLiquidPlacement);

typedef MVariant<PlaceMaterial, PlaceMod, PlaceMaterialColor, PlaceLiquid> TileModification;
typedef List<pair<Vec2I, TileModification>> TileModificationList;

}

#endif