AStarTest.Map.GetWeight C# (CSharp) 메소드

GetWeight() 공개 메소드

public GetWeight ( IntVector3 p ) : int
p IntVector3
리턴 int
        public int GetWeight(IntVector3 p)
        {
            return this.Grid[p.Z, p.Y, p.X].Weight;
        }

Usage Example

예제 #1
0
            ushort IAStarTarget.GetCostBetween(IntVector3 src, IntVector3 dst)
            {
                ushort cost = (src - dst).ManhattanLength == 1 ? (ushort)COST_STRAIGHT : (ushort)COST_DIAGONAL;

                cost += (ushort)m_env.GetWeight(dst);
                return(cost);
            }