public void GetSpaceNodesInRangeTest() { IPartitionSpace target = CreateIPartitionSpace(); // TODO: 初始化为适当的值 object sender = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs eventArgs = null; // TODO: 初始化为适当的值 target.GetSpaceNodesInRange(sender, eventArgs); Assert.Inconclusive("无法验证不返回值的方法。"); }
public void GetGetSpaceNodesInRangeEventArgsConstructorTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs(x, y, z, fRange, map); Assert.Inconclusive("TODO: 实现用来验证目标的代码"); }
public void YTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs( x, y, z, fRange, map ); // TODO: 初始化为适当的值 float actual; actual = target.Y; Assert.Inconclusive( "验证此测试方法的正确性。" ); }
public void XTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs(x, y, z, fRange, map); // TODO: 初始化为适当的值 float actual; actual = target.X; Assert.Inconclusive("验证此测试方法的正确性。"); }
public void SpaceNodesTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs(x, y, z, fRange, map); // TODO: 初始化为适当的值 MapSpaceNode[] expected = null; // TODO: 初始化为适当的值 MapSpaceNode[] actual; target.SpaceNodes = expected; actual = target.SpaceNodes; Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public void GetSpaceNodesInRange(object sender, GetGetSpaceNodesInRangeEventArgs eventArgs) { List <MapSpaceNode> mapSpaceNodeList = new List <MapSpaceNode>(); Point3D point3D = eventArgs.Map.Bound(eventArgs.X, eventArgs.Y, eventArgs.Z); Point3D startPoint3D = eventArgs.Map.MapRectangle.Start; // 获取区域点 float fGridOffsetX = eventArgs.Map.MapRectangle.Width - (point3D.X - startPoint3D.X); int iGridCellPointX = (int)(fGridOffsetX / SIZE_OF_GRID_CELL); float fGridOffsetY = eventArgs.Map.MapRectangle.Height - (point3D.Y - startPoint3D.Y); int iGridCellPointY = (int)(fGridOffsetY / SIZE_OF_GRID_CELL); // 计算有多少Cell在Range内的数量 int iCellCount = (int)(eventArgs.Range / SIZE_OF_GRID_CELL); // 再加上额外的计算得到正偏移的数量 int iPlusCountX = iCellCount + ((eventArgs.Range % SIZE_OF_GRID_CELL) > (SIZE_OF_GRID_CELL - (fGridOffsetX % SIZE_OF_GRID_CELL)) ? 1 : 0); int iPlusCountY = iCellCount + ((eventArgs.Range % SIZE_OF_GRID_CELL) > (SIZE_OF_GRID_CELL - (fGridOffsetY % SIZE_OF_GRID_CELL)) ? 1 : 0); // 获取正偏移的Cell空间节点(MapSpaceNode) for (int iPlusOffsetX = 0; iPlusOffsetX < iPlusCountX; iPlusOffsetX++) { for (int iPlusOffsetY = 0; iPlusOffsetY < iPlusCountY; iPlusOffsetY++) { MapSpaceNode getSubSpaceNode = GetSubSpaceNode(iGridCellPointX + iPlusOffsetX, iGridCellPointY + iPlusOffsetY, eventArgs.Map); if (getSubSpaceNode == null) { continue; } else { mapSpaceNodeList.Add(getSubSpaceNode); } } } // 再加上额外的计算得到负偏移的数量 int iMinusX = iCellCount + ((eventArgs.Range % SIZE_OF_GRID_CELL) > (fGridOffsetX % SIZE_OF_GRID_CELL) ? 1 : 0); int iMinusY = iCellCount + ((eventArgs.Range % SIZE_OF_GRID_CELL) > (fGridOffsetY % SIZE_OF_GRID_CELL) ? 1 : 0); // 获取负偏移的Cell空间节点(MapSpaceNode) for (int iMinusOffsetX = 0; iMinusOffsetX < iPlusCountX; iMinusOffsetX++) { for (int iMinusOffsetY = 0; iMinusOffsetY < iPlusCountY; iMinusOffsetY++) { MapSpaceNode getSubSpaceNode = GetSubSpaceNode(iGridCellPointX - iMinusOffsetX, iGridCellPointY - iMinusOffsetY, eventArgs.Map); if (getSubSpaceNode == null) { continue; } else { mapSpaceNodeList.Add(getSubSpaceNode); } } } eventArgs.SpaceNodes = mapSpaceNodeList.ToArray(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public void GetSpaceNodesInRange( object sender, GetGetSpaceNodesInRangeEventArgs eventArgs ) { List<MapSpaceNode> mapSpaceNodeList = new List<MapSpaceNode>(); Point3D point3D = eventArgs.Map.Bound( eventArgs.X, eventArgs.Y, eventArgs.Z ); Point3D startPoint3D = eventArgs.Map.MapRectangle.Start; // 获取区域点 float fGridOffsetX = eventArgs.Map.MapRectangle.Width - ( point3D.X - startPoint3D.X ); int iGridCellPointX = (int)( fGridOffsetX / SIZE_OF_GRID_CELL ); float fGridOffsetY = eventArgs.Map.MapRectangle.Height - ( point3D.Y - startPoint3D.Y ); int iGridCellPointY = (int)( fGridOffsetY / SIZE_OF_GRID_CELL ); // 计算有多少Cell在Range内的数量 int iCellCount = (int)( eventArgs.Range / SIZE_OF_GRID_CELL ); // 再加上额外的计算得到正偏移的数量 int iPlusCountX = iCellCount + ( ( eventArgs.Range % SIZE_OF_GRID_CELL ) > ( SIZE_OF_GRID_CELL - ( fGridOffsetX % SIZE_OF_GRID_CELL ) ) ? 1 : 0 ); int iPlusCountY = iCellCount + ( ( eventArgs.Range % SIZE_OF_GRID_CELL ) > ( SIZE_OF_GRID_CELL - ( fGridOffsetY % SIZE_OF_GRID_CELL ) ) ? 1 : 0 ); // 获取正偏移的Cell空间节点(MapSpaceNode) for ( int iPlusOffsetX = 0; iPlusOffsetX < iPlusCountX; iPlusOffsetX++ ) { for ( int iPlusOffsetY = 0; iPlusOffsetY < iPlusCountY; iPlusOffsetY++ ) { MapSpaceNode getSubSpaceNode = GetSubSpaceNode( iGridCellPointX + iPlusOffsetX, iGridCellPointY + iPlusOffsetY, eventArgs.Map ); if ( getSubSpaceNode == null ) continue; else mapSpaceNodeList.Add( getSubSpaceNode ); } } // 再加上额外的计算得到负偏移的数量 int iMinusX = iCellCount + ( ( eventArgs.Range % SIZE_OF_GRID_CELL ) > ( fGridOffsetX % SIZE_OF_GRID_CELL ) ? 1 : 0 ); int iMinusY = iCellCount + ( ( eventArgs.Range % SIZE_OF_GRID_CELL ) > ( fGridOffsetY % SIZE_OF_GRID_CELL ) ? 1 : 0 ); // 获取负偏移的Cell空间节点(MapSpaceNode) for ( int iMinusOffsetX = 0; iMinusOffsetX < iPlusCountX; iMinusOffsetX++ ) { for ( int iMinusOffsetY = 0; iMinusOffsetY < iPlusCountY; iMinusOffsetY++ ) { MapSpaceNode getSubSpaceNode = GetSubSpaceNode( iGridCellPointX - iMinusOffsetX, iGridCellPointY - iMinusOffsetY, eventArgs.Map ); if ( getSubSpaceNode == null ) continue; else mapSpaceNodeList.Add( getSubSpaceNode ); } } eventArgs.SpaceNodes = mapSpaceNodeList.ToArray(); }
public void GetGetSpaceNodesInRangeEventArgsConstructorTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs( x, y, z, fRange, map ); Assert.Inconclusive( "TODO: 实现用来验证目标的代码" ); }
public void SpaceNodesTest() { float x = 0F; // TODO: 初始化为适当的值 float y = 0F; // TODO: 初始化为适当的值 float z = 0F; // TODO: 初始化为适当的值 float fRange = 0F; // TODO: 初始化为适当的值 BaseMap map = null; // TODO: 初始化为适当的值 GetGetSpaceNodesInRangeEventArgs target = new GetGetSpaceNodesInRangeEventArgs( x, y, z, fRange, map ); // TODO: 初始化为适当的值 MapSpaceNode[] expected = null; // TODO: 初始化为适当的值 MapSpaceNode[] actual; target.SpaceNodes = expected; actual = target.SpaceNodes; Assert.AreEqual( expected, actual ); Assert.Inconclusive( "验证此测试方法的正确性。" ); }