static public String toString( CondDir dir ) { switch( dir ) { case CondDir.Top: return "上"; case CondDir.Left: return "左"; case CondDir.Right: return "右"; case CondDir.Bottom: return "下"; case CondDir.Front: return "前"; case CondDir.Back: return "後"; } return "Error dir"; }
public WallName getRelDirWall( WallName name , CondDir dir ) { int idx = getWallIndex(name); idx = getRelDirWallIndex(idx, dir); return wall[idx].name; }
public bool checkVaild( WallName a , WallName b , CondDir dir ) { int idxA = getWallIndex(a); int idxB = getWallIndex(b); return getRelDirWallIndex(idxA, dir) == idxB; }
public int getRelDirWallIndex( int idx , CondDir dir ) { return getRelDirIndex(idx, dir, false); }
public bool isTopFireLighting( WallName nearWallName , CondDir dir , bool bFaceWall ) { int idx = getWallIndex(nearWallName); return bTopFireLighting[ getRelDirIndex( idx , dir , bFaceWall ) ]; }
public int getRelDirIndex( int index , CondDir dir , bool bFaceWall ) { int result = index + (int)dir; if ( bFaceWall == false ) result += 2; return result % 4; }