2using System.Collections.Generic;
27 return g.subType
switch
29 BiomeProfile.BaseTile.SubType.Rnd5 =>
EClass.
rnd(5) == 0,
30 BiomeProfile.BaseTile.SubType.Rnd10 =>
EClass.
rnd(10) == 0,
31 BiomeProfile.BaseTile.SubType.Rnd20 =>
EClass.
rnd(20) == 0,
32 BiomeProfile.BaseTile.SubType.Pattern => (
x +
y % 2) % 2 == 0,
39 bool flag =
IsSub(t,
x, z);
45 bool flag =
IsSub(t,
x, z);
46 SetBlock(
x, z, (idMat != -1) ? idMat : (flag ? t.matSub : t.mat), flag ? t.idSub : t.id);
49 public void SetFloor(
int x,
int z,
int idMat,
int idFloor,
int direction = 0)
52 cell._floorMat = (byte)idMat;
53 cell._floor = (byte)idFloor;
54 cell.floorDir = direction;
57 public void SetBlock(
int x,
int z,
int idMat,
int idBlock,
int direction = 0)
60 cell._blockMat = (byte)idMat;
61 cell._block = (byte)idBlock;
62 cell.blockDir = direction;
96 List<Point> list =
new List<Point>();
103 for (
int j =
x; j <
x +
width; j++)
159 for (
int i = 0; i < 200; i++)
165 if (genBounds.
x > 0 && genBounds.
y > 0)
190 if (partialMap ==
null)
192 Debug.Log(
"TryAddMap Piece: no map");
195 bool flag = partialMap.dir == 1 || partialMap.dir == 3;
202 onCreate?.Invoke(partialMap, bounds);
static GenBounds Create(Zone z)
List< Point > ListEmptyPoint()
void SetBlock(BiomeProfile.Tile t, int x, int z, int idMat=-1)
GenBounds GetBounds(int w, int h, bool ignoreBlock)
void SetBlock(int x, int z, int idMat, int idBlock, int direction=0)
Func< Cell, bool > FuncCheckEmpty
PartialMap TryAddMapPiece(MapPiece.Type type=MapPiece.Type.Any, float ruin=-1f, string tags=null, Action< PartialMap, GenBounds > onCreate=null)
void SetFloor(int x, int z, int idMat, int idFloor, int direction=0)
void SetFloor(BiomeProfile.Tile t, int x, int z)
bool IsSub(BiomeProfile.Tile g, int x, int y)
GenBounds GetBounds(Map map, Zone zone, int x, int y, int width, int height, int dw, int dh, bool ignoreBlock)
PartialMap GetMap(Type type, string tag, float ruin)
void Apply(Point _point, ApplyMode mode)