수정중

This commit is contained in:
김민구
2020-12-18 17:42:37 +09:00
parent 7c35e8febd
commit 3c68ea8736
8 changed files with 25 additions and 22 deletions

Binary file not shown.

View File

@@ -127,6 +127,9 @@ namespace AStarPathFinding
switch(tableStateData[i, j]) switch(tableStateData[i, j])
{ {
case eTileState.Start: case eTileState.Start:
case eTileState.Goal: case eTileState.Goal:
case eTileState.Wall: case eTileState.Wall:
case eTileState.Road: case eTileState.Road:
@@ -330,33 +333,33 @@ namespace AStarPathFinding
continue; continue;
} }
if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.RRoad & Form1.Direction == "Left") //if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.RRoad & Form1.Direction == "Left")
{ //{
openNode = tableNodeData[tempChildAxis.X, tempChildAxis.Y]; // openNode = tableNodeData[tempChildAxis.X, tempChildAxis.Y];
openNode.SetParent(focusNode); // openNode.SetParent(focusNode);
openNode.SetGCost(gCost + openNode.parent.R); // openNode.SetGCost(gCost + openNode.parent.R);
openNode.SetHCost(openNode.parent.R + 1000); // openNode.SetHCost(openNode.parent.R + 1000);
openNode.ParentDirection = neerAxis[i]; // openNode.ParentDirection = neerAxis[i];
dicOpenList.Add(tempChildAxis, openNode); // dicOpenList.Add(tempChildAxis, openNode);
tableStateData[tempChildAxis.X, tempChildAxis.Y] = eTileState.Open; // tableStateData[tempChildAxis.X, tempChildAxis.Y] = eTileState.Open;
continue; // continue;
} //}
if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.LRoad & Form1.Direction == "Right") //if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.LRoad & Form1.Direction == "Right")
{ //{
openNode = tableNodeData[tempChildAxis.X, tempChildAxis.Y]; // openNode = tableNodeData[tempChildAxis.X, tempChildAxis.Y];
openNode.SetParent(focusNode); // openNode.SetParent(focusNode);
openNode.SetGCost(gCost + openNode.parent.L); // openNode.SetGCost(gCost + openNode.parent.L);
openNode.SetHCost(openNode.parent.L + 1000); // 휴리스틱 값 수정해서 길 따라갈 수 있게 점수를 낮춰줌 수정 // openNode.SetHCost(openNode.parent.L + 1000); // 휴리스틱 값 수정해서 길 따라갈 수 있게 점수를 낮춰줌 수정
openNode.ParentDirection = neerAxis[i]; // openNode.ParentDirection = neerAxis[i];
dicOpenList.Add(tempChildAxis, openNode); // dicOpenList.Add(tempChildAxis, openNode);
tableStateData[tempChildAxis.X, tempChildAxis.Y] = eTileState.Open; // tableStateData[tempChildAxis.X, tempChildAxis.Y] = eTileState.Open;
continue; // continue;
} //}
if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.LRoad & Form1.Direction == "Left") if (tableStateData[tempChildAxis.X, tempChildAxis.Y] == eTileState.LRoad & Form1.Direction == "Left")
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.