File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/test/java/dev/rollczi/liteindex/cases Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ package dev .rollczi .liteindex .cases ;
2+
3+ import dev .rollczi .liteindex .mock .Area ;
4+ import dev .rollczi .liteindex .mock .Vector3d ;
5+ import dev .rollczi .liteindex .space .SpaceIndex ;
6+ import dev .rollczi .liteindex .space .indexing .IndexingAlgorithm ;
7+ import org .junit .jupiter .api .Test ;
8+
9+ import java .util .List ;
10+
11+ import static org .assertj .core .api .AssertionsForInterfaceTypes .assertThat ;
12+
13+ class TestCases {
14+
15+ @ Test
16+ void vLuckyCase () {
17+ SpaceIndex <Area , Vector3d > index = SpaceIndex .<Area , Vector3d >builder ()
18+ .axisX (vector3d -> vector3d .getX ())
19+ .axisZ (vector3d -> vector3d .getZ ())
20+ .axisY (vector3d -> vector3d .getY ())
21+ .space (area -> area .getMin (), area -> area .getMax ())
22+ .indexing (IndexingAlgorithm .calculateOptimal (10_000 , 75 ))
23+ .build ();
24+
25+ Vector3d min = new Vector3d (823 , 0 , 917 );
26+ Vector3d max = new Vector3d (min .getX () + 21 , 255 , min .getZ () + 21 );
27+
28+ Area area = new Area (min , max );
29+
30+ index .put (area );
31+
32+ List <Area > areas = index .get (new Vector3d (823 , 134 , 927 ));
33+
34+ assertThat (areas )
35+ .hasSize (1 )
36+ .containsOnly (area );
37+ }
38+
39+ }
You can’t perform that action at this time.
0 commit comments