forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeoStructure.cs
More file actions
67 lines (57 loc) · 3.21 KB
/
Copy pathGeoStructure.cs
File metadata and controls
67 lines (57 loc) · 3.21 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
namespace L2dotNET.GeoEngine.Geodata
{
public class GeoStructure
{
public static int TileXMin = 16;
public static int TileXMax = 26;
public static int TileYMin = 10;
public static int TileYMax = 25;
public static int TileSize = 32768;
public static int WorldXMin = (TileXMin - 20) * TileSize;
public static int WorldXMax = (TileXMax - 19) * TileSize;
public static int WorldYMin = (TileYMin - 18) * TileSize;
public static int WorldYMax = (TileYMax - 17) * TileSize;
private const int RegionSize = 4096;
private static int _regionsX = (WorldXMax - WorldXMin) / RegionSize;
private static int _regionsY = (WorldYMax - WorldYMin) / RegionSize;
private static int _regionXOffset = Math.Abs(WorldXMin / RegionSize);
private static int _regionYOffset = Math.Abs(WorldYMin / RegionSize);
public static readonly byte CellFlagE = 1 << 0;
public static readonly byte CellFlagW = 1 << 1;
public static readonly byte CellFlagS = 1 << 2;
public static readonly byte CellFlagN = 1 << 3;
public static readonly byte CellFlagSe = 1 << 4;
public static readonly byte CellFlagSw = 1 << 5;
public static readonly byte CellFlagNe = 1 << 6;
public static readonly byte CellFlagNw = 1 << 7;
public static readonly byte CellFlagSAndE = (byte)(CellFlagS | CellFlagE);
public static readonly byte CellFlagSAndW = (byte)(CellFlagS | CellFlagW);
public static readonly byte CellFlagNAndE = (byte)(CellFlagN | CellFlagE);
public static readonly byte CellFlagNAndW = (byte)(CellFlagN | CellFlagW);
public static readonly int CellSize = 16;
public static readonly int CellHeight = 8;
public static readonly int CellIgnoreHeight = CellHeight * 6;
public static readonly byte TypeFlatL2Jl2Off = 0;
public static readonly byte TypeFlatL2D = 0xD0;
public static readonly byte TypeComplexL2J = 1;
public static readonly byte TypeComplexL2Off = 0x40;
public static readonly byte TypeComplexL2D = 0xD1;
public static readonly byte TypeMultilayerL2J = 2;
public static readonly byte TypeMultilayerL2D = 0xD2;
public static readonly int BlockCellsX = 8;
public static readonly int BlockCellsY = 8;
public static readonly int BlockCells = BlockCellsX * BlockCellsY;
public static readonly int RegionBlocksX = 256;
public static readonly int RegionBlocksY = 256;
public static readonly int RegionBlocks = RegionBlocksX * RegionBlocksY;
public static readonly int RegionCellsX = RegionBlocksX * BlockCellsX;
public static readonly int RegionCellsY = RegionBlocksY * BlockCellsY;
public static readonly int GeoRegionsX = (TileXMax - TileXMin) + 1;
public static readonly int GeoRegionsY = (TileYMax - TileYMin) + 1;
public static readonly int GeoBlocksX = GeoRegionsX * RegionBlocksX;
public static readonly int GeoBlocksY = GeoRegionsY * RegionBlocksY;
public static readonly int GeoCellsX = GeoBlocksX * BlockCellsX;
public static readonly int GeoCellsY = GeoBlocksY * BlockCellsY;
}
}