Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / room / AutoTileConfig.cs
@小李xl 小李xl on 11 Jan 2024 25 KB 制作2x2地形,还有bug
  1.  
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Godot;
  5.  
  6. /// <summary>
  7. /// 房间图块配置信息
  8. /// </summary>
  9. public class AutoTileConfig
  10. {
  11. public TileCellData Floor;
  12. public TileCellData TopMask;
  13. public TileCellData Wall_Bottom;
  14. public TileCellData Wall_Left;
  15. public TileCellData Wall_Right;
  16. public TileCellData Wall_Top;
  17. public TileCellData Wall_Out_LB;
  18. public TileCellData Wall_Out_LT;
  19. public TileCellData Wall_Out_RB;
  20. public TileCellData Wall_Out_RT;
  21. public TileCellData Wall_In_LT;
  22. public TileCellData Wall_In_LB;
  23. public TileCellData Wall_In_RT;
  24. public TileCellData Wall_In_RB;
  25. public TileCellData Wall_Vertical_Left;
  26. public TileCellData Wall_Vertical_Center;
  27. public TileCellData Wall_Vertical_Right;
  28. public TileCellData Wall_Vertical_Single;
  29. //----------------------------- 所有自动图块数据 -----------------------------
  30. //----------------------------- 命名规则: Auto_ + LT + T + RT + _ + L + C + R + _ + LB + B + RB
  31. //第一列
  32. public TileCellData Auto_000_010_010;
  33. public TileCellData Auto_010_010_010;
  34. public TileCellData Auto_010_010_000;
  35. public TileCellData Auto_000_010_000;
  36. //第二列
  37. public TileCellData Auto_000_011_010;
  38. public TileCellData Auto_010_011_010;
  39. public TileCellData Auto_010_011_000;
  40. public TileCellData Auto_000_011_000;
  41. //第三列
  42. public TileCellData Auto_000_111_010;
  43. public TileCellData Auto_010_111_010;
  44. public TileCellData Auto_010_111_000;
  45. public TileCellData Auto_000_111_000;
  46. //第四列
  47. public TileCellData Auto_000_110_010;
  48. public TileCellData Auto_010_110_010;
  49. public TileCellData Auto_010_110_000;
  50. public TileCellData Auto_000_110_000;
  51. //第五列
  52. public TileCellData Auto_110_111_010;
  53. public TileCellData Auto_010_011_011;
  54. public TileCellData Auto_011_011_010;
  55. public TileCellData Auto_010_111_110;
  56. //第六列
  57. public TileCellData Auto_000_111_011;
  58. public TileCellData Auto_011_111_111;
  59. public TileCellData Auto_111_111_011;
  60. public TileCellData Auto_011_111_000;
  61. //第七列
  62. public TileCellData Auto_000_111_110;
  63. public TileCellData Auto_110_111_111;
  64. public TileCellData Auto_111_111_110;
  65. public TileCellData Auto_110_111_000;
  66. //第八列
  67. public TileCellData Auto_011_111_010;
  68. public TileCellData Auto_010_110_110;
  69. public TileCellData Auto_110_110_010;
  70. public TileCellData Auto_010_111_011;
  71. //第九列
  72. public TileCellData Auto_000_011_011;
  73. public TileCellData Auto_011_011_011;
  74. public TileCellData Auto_011_111_011;
  75. public TileCellData Auto_011_011_000;
  76. //第十列
  77. public TileCellData Auto_010_111_111;
  78. public TileCellData Auto_110_111_011;
  79. public TileCellData Auto_111_111_111;
  80. public TileCellData Auto_111_111_000;
  81. //第十一列
  82. public TileCellData Auto_000_111_111;
  83. public TileCellData Auto_011_111_110;
  84. public TileCellData Auto_111_111_010;
  85. //第十二列
  86. public TileCellData Auto_000_110_110;
  87. public TileCellData Auto_110_111_110;
  88. public TileCellData Auto_110_110_110;
  89. public TileCellData Auto_110_110_000;
  90. //-------------------------------------------------------------------------
  91.  
  92. /// <summary>
  93. /// 所属资源Id
  94. /// </summary>
  95. public int SourceId { get; private set; }
  96. /// <summary>
  97. /// 原地形配置数据
  98. /// </summary>
  99. public TileSetTerrainInfo TerrainInfo { get; private set; }
  100. private Dictionary<Vector2I, TileCellData> _mapping = new Dictionary<Vector2I, TileCellData>();
  101.  
  102. public AutoTileConfig(int sourceId, TileSetTerrainInfo terrainInfo)
  103. {
  104. SourceId = sourceId;
  105. TerrainInfo = terrainInfo;
  106. if (terrainInfo.T != null)
  107. {
  108. foreach (var keyValuePair in terrainInfo.T)
  109. {
  110. HandlerTileData(keyValuePair.Key, sourceId, terrainInfo.GetPosition(keyValuePair.Value));
  111. }
  112. }
  113.  
  114. if (terrainInfo.M != null)
  115. {
  116. int[] data;
  117. if (terrainInfo.M.TryGetValue(0, out data))
  118. {
  119. Wall_Vertical_Single = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer);
  120. }
  121. if (terrainInfo.M.TryGetValue(1, out data))
  122. {
  123. Wall_Vertical_Left= new TileCellData(sourceId, terrainInfo.GetPosition(data), 1, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer);
  124. }
  125. if (terrainInfo.M.TryGetValue(2, out data))
  126. {
  127. Wall_Vertical_Center= new TileCellData(sourceId, terrainInfo.GetPosition(data), 2, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer);
  128. }
  129. if (terrainInfo.M.TryGetValue(3, out data))
  130. {
  131. Wall_Vertical_Right= new TileCellData(sourceId, terrainInfo.GetPosition(data), 3, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer);
  132. }
  133. }
  134. if (terrainInfo.F != null)
  135. {
  136. if (terrainInfo.F.TryGetValue(0, out var data))
  137. {
  138. Floor = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.FloorLayerType, GameConfig.FloorMapLayer);
  139. }
  140. }
  141. TopMask = Auto_111_111_111;
  142. Wall_Bottom = Auto_000_111_111;
  143. Wall_Left = Auto_110_110_110;
  144. Wall_Right = Auto_011_011_011;
  145. Wall_Top = Auto_111_111_000;
  146.  
  147. Wall_Out_LB = Auto_011_011_000;
  148. Wall_Out_LT = Auto_000_011_011;
  149. Wall_Out_RB = Auto_110_110_000;
  150. Wall_Out_RT = Auto_000_110_110;
  151.  
  152. Wall_In_LT = Auto_111_111_110;
  153. Wall_In_LB = Auto_110_111_111;
  154. Wall_In_RT = Auto_111_111_011;
  155. Wall_In_RB = Auto_011_111_111;
  156.  
  157. HandlerMapping();
  158. HandlerOtherCellMapping();
  159. }
  160.  
  161. public int GetLayer(Vector2I atlasCoords)
  162. {
  163. if (_mapping.TryGetValue(atlasCoords, out var tile))
  164. {
  165. return tile.DefaultLayer;
  166. }
  167.  
  168. return GameConfig.FloorMapLayer;
  169. }
  170.  
  171. public TileCellData GetCellData(Vector2I atlasCoords)
  172. {
  173. _mapping.TryGetValue(atlasCoords, out var tile);
  174. return tile;
  175. }
  176.  
  177. private void HandlerTileData(uint peeringValue, int sourceId, Vector2I pos)
  178. {
  179. switch (peeringValue)
  180. {
  181. //第一列
  182. case TerrainPeering.Center | TerrainPeering.Bottom:
  183. Auto_000_010_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  184. break;
  185. case TerrainPeering.Top | TerrainPeering.Center | TerrainPeering.Bottom:
  186. Auto_010_010_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  187. break;
  188. case TerrainPeering.Top | TerrainPeering.Center:
  189. Auto_010_010_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  190. break;
  191. case TerrainPeering.Center:
  192. Auto_000_010_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  193. break;
  194. //第二列
  195. case TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom:
  196. Auto_000_011_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  197. break;
  198. case TerrainPeering.Top | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom:
  199. Auto_010_011_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  200. break;
  201. case TerrainPeering.Top | TerrainPeering.Center | TerrainPeering.Right:
  202. Auto_010_011_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  203. break;
  204. case TerrainPeering.Center | TerrainPeering.Right:
  205. Auto_000_011_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  206. break;
  207. //第三列
  208. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom:
  209. Auto_000_111_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  210. break;
  211. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right |
  212. TerrainPeering.Bottom:
  213. Auto_010_111_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  214. break;
  215. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right:
  216. Auto_010_111_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  217. break;
  218. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right:
  219. Auto_000_111_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  220. break;
  221. //第四列
  222. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Bottom:
  223. Auto_000_110_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  224. break;
  225. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Bottom:
  226. Auto_010_110_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  227. break;
  228. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center:
  229. Auto_010_110_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  230. break;
  231. case TerrainPeering.Left | TerrainPeering.Center:
  232. Auto_000_110_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  233. break;
  234. //第五列
  235. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  236. TerrainPeering.Right | TerrainPeering.Bottom:
  237. Auto_110_111_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  238. break;
  239. case TerrainPeering.Top | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom |
  240. TerrainPeering.RightBottom:
  241. Auto_010_011_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  242. break;
  243. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Center | TerrainPeering.Right |
  244. TerrainPeering.Bottom:
  245. Auto_011_011_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  246. break;
  247. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right |
  248. TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  249. Auto_010_111_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  250. break;
  251. //第六列
  252. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom |
  253. TerrainPeering.RightBottom:
  254. Auto_000_111_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  255. break;
  256. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left | TerrainPeering.Center |
  257. TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  258. Auto_011_111_111 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  259. break;
  260. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left |
  261. TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  262. Auto_111_111_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  263. break;
  264. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left | TerrainPeering.Center |
  265. TerrainPeering.Right:
  266. Auto_011_111_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  267. break;
  268. //第七列
  269. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.LeftBottom |
  270. TerrainPeering.Bottom:
  271. Auto_000_111_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  272. break;
  273. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  274. TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  275. Auto_110_111_111 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  276. break;
  277. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left |
  278. TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  279. Auto_111_111_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  280. break;
  281. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  282. TerrainPeering.Right:
  283. Auto_110_111_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  284. break;
  285. //第八列
  286. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left | TerrainPeering.Center |
  287. TerrainPeering.Right | TerrainPeering.Bottom:
  288. Auto_011_111_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  289. break;
  290. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.LeftBottom |
  291. TerrainPeering.Bottom:
  292. Auto_010_110_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  293. break;
  294. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  295. TerrainPeering.Bottom:
  296. Auto_110_110_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  297. break;
  298. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right |
  299. TerrainPeering.Bottom | TerrainPeering.RightBottom:
  300. Auto_010_111_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  301. break;
  302. //第九列
  303. case TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  304. Auto_000_011_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  305. break;
  306. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Center | TerrainPeering.Right |
  307. TerrainPeering.Bottom | TerrainPeering.RightBottom:
  308. Auto_011_011_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  309. break;
  310. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left | TerrainPeering.Center |
  311. TerrainPeering.Right | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  312. Auto_011_111_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  313. break;
  314. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Center | TerrainPeering.Right:
  315. Auto_011_011_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  316. break;
  317. //第十列
  318. case TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right |
  319. TerrainPeering.LeftBottom | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  320. Auto_010_111_111 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  321. break;
  322. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  323. TerrainPeering.Right | TerrainPeering.Bottom | TerrainPeering.RightBottom:
  324. Auto_110_111_011 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  325. break;
  326. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left |
  327. TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom |
  328. TerrainPeering.RightBottom:
  329. Auto_111_111_111 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  330. break;
  331. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left |
  332. TerrainPeering.Center | TerrainPeering.Right:
  333. Auto_111_111_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  334. break;
  335. //第十一列
  336. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.LeftBottom |
  337. TerrainPeering.Bottom | TerrainPeering.RightBottom:
  338. Auto_000_111_111 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  339. break;
  340. case TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left | TerrainPeering.Center |
  341. TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  342. Auto_011_111_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  343. break;
  344. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.RightTop | TerrainPeering.Left |
  345. TerrainPeering.Center | TerrainPeering.Right | TerrainPeering.Bottom:
  346. Auto_111_111_010 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  347. break;
  348. //第十二列
  349. case TerrainPeering.Left | TerrainPeering.Center | TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  350. Auto_000_110_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  351. break;
  352. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  353. TerrainPeering.Right | TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  354. Auto_110_111_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  355. break;
  356. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center |
  357. TerrainPeering.LeftBottom | TerrainPeering.Bottom:
  358. Auto_110_110_110 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.TopMapLayer);
  359. break;
  360. case TerrainPeering.LeftTop | TerrainPeering.Top | TerrainPeering.Left | TerrainPeering.Center:
  361. Auto_110_110_000 = new TileCellData(sourceId, pos, peeringValue, TileSetTerrainInfo.TerrainLayerType, GameConfig.MiddleMapLayer);
  362. break;
  363.  
  364. default:
  365. Debug.LogError("未知PeeringValue: " + peeringValue);
  366. break;
  367. }
  368. }
  369.  
  370.  
  371. private void HandlerMapping()
  372. {
  373. //第一列
  374. _mapping.Add(Auto_000_010_010.AutoTileCoords, Auto_000_010_010);
  375. _mapping.Add(Auto_010_010_010.AutoTileCoords, Auto_010_010_010);
  376. _mapping.Add(Auto_010_010_000.AutoTileCoords, Auto_010_010_000);
  377. _mapping.Add(Auto_000_010_000.AutoTileCoords, Auto_000_010_000);
  378. //第二列
  379. _mapping.Add(Auto_000_011_010.AutoTileCoords, Auto_000_011_010);
  380. _mapping.Add(Auto_010_011_010.AutoTileCoords, Auto_010_011_010);
  381. _mapping.Add(Auto_010_011_000.AutoTileCoords, Auto_010_011_000);
  382. _mapping.Add(Auto_000_011_000.AutoTileCoords, Auto_000_011_000);
  383. //第三列
  384. _mapping.Add(Auto_000_111_010.AutoTileCoords, Auto_000_111_010);
  385. _mapping.Add(Auto_010_111_010.AutoTileCoords, Auto_010_111_010);
  386. _mapping.Add(Auto_010_111_000.AutoTileCoords, Auto_010_111_000);
  387. _mapping.Add(Auto_000_111_000.AutoTileCoords, Auto_000_111_000);
  388. //第四列
  389. _mapping.Add(Auto_000_110_010.AutoTileCoords, Auto_000_110_010);
  390. _mapping.Add(Auto_010_110_010.AutoTileCoords, Auto_010_110_010);
  391. _mapping.Add(Auto_010_110_000.AutoTileCoords, Auto_010_110_000);
  392. _mapping.Add(Auto_000_110_000.AutoTileCoords, Auto_000_110_000);
  393. //第五列
  394. _mapping.Add(Auto_110_111_010.AutoTileCoords, Auto_110_111_010);
  395. _mapping.Add(Auto_010_011_011.AutoTileCoords, Auto_010_011_011);
  396. _mapping.Add(Auto_011_011_010.AutoTileCoords, Auto_011_011_010);
  397. _mapping.Add(Auto_010_111_110.AutoTileCoords, Auto_010_111_110);
  398. //第六列
  399. _mapping.Add(Auto_000_111_011.AutoTileCoords, Auto_000_111_011);
  400. _mapping.Add(Auto_011_111_111.AutoTileCoords, Auto_011_111_111);
  401. _mapping.Add(Auto_111_111_011.AutoTileCoords, Auto_111_111_011);
  402. _mapping.Add(Auto_011_111_000.AutoTileCoords, Auto_011_111_000);
  403. //第七列
  404. _mapping.Add(Auto_000_111_110.AutoTileCoords, Auto_000_111_110);
  405. _mapping.Add(Auto_110_111_111.AutoTileCoords, Auto_110_111_111);
  406. _mapping.Add(Auto_111_111_110.AutoTileCoords, Auto_111_111_110);
  407. _mapping.Add(Auto_110_111_000.AutoTileCoords, Auto_110_111_000);
  408. //第八列
  409. _mapping.Add(Auto_011_111_010.AutoTileCoords, Auto_011_111_010);
  410. _mapping.Add(Auto_010_110_110.AutoTileCoords, Auto_010_110_110);
  411. _mapping.Add(Auto_110_110_010.AutoTileCoords, Auto_110_110_010);
  412. _mapping.Add(Auto_010_111_011.AutoTileCoords, Auto_010_111_011);
  413. //第九列
  414. _mapping.Add(Auto_000_011_011.AutoTileCoords, Auto_000_011_011);
  415. _mapping.Add(Auto_011_011_011.AutoTileCoords, Auto_011_011_011);
  416. _mapping.Add(Auto_011_111_011.AutoTileCoords, Auto_011_111_011);
  417. _mapping.Add(Auto_011_011_000.AutoTileCoords, Auto_011_011_000);
  418. //第十列
  419. _mapping.Add(Auto_010_111_111.AutoTileCoords, Auto_010_111_111);
  420. _mapping.Add(Auto_110_111_011.AutoTileCoords, Auto_110_111_011);
  421. _mapping.Add(Auto_111_111_111.AutoTileCoords, Auto_111_111_111);
  422. _mapping.Add(Auto_111_111_000.AutoTileCoords, Auto_111_111_000);
  423. //第十一列
  424. _mapping.Add(Auto_000_111_111.AutoTileCoords, Auto_000_111_111);
  425. _mapping.Add(Auto_011_111_110.AutoTileCoords, Auto_011_111_110);
  426. _mapping.Add(Auto_111_111_010.AutoTileCoords, Auto_111_111_010);
  427. //第十二列
  428. _mapping.Add(Auto_000_110_110.AutoTileCoords, Auto_000_110_110);
  429. _mapping.Add(Auto_110_111_110.AutoTileCoords, Auto_110_111_110);
  430. _mapping.Add(Auto_110_110_110.AutoTileCoords, Auto_110_110_110);
  431. _mapping.Add(Auto_110_110_000.AutoTileCoords, Auto_110_110_000);
  432. }
  433.  
  434. private void HandlerOtherCellMapping()
  435. {
  436. _mapping.Add(Floor.AutoTileCoords, Floor);
  437. _mapping.Add(Wall_Vertical_Left.AutoTileCoords, Wall_Vertical_Left);
  438. _mapping.Add(Wall_Vertical_Right.AutoTileCoords, Wall_Vertical_Right);
  439. _mapping.Add(Wall_Vertical_Center.AutoTileCoords, Wall_Vertical_Center);
  440. _mapping.Add(Wall_Vertical_Single.AutoTileCoords, Wall_Vertical_Single);
  441. }
  442. }