Initial work on data structures. Saving for move to another computer.

main
Bryson Zimmerman 12 months ago
parent 6d545e8b18
commit 8fa4825f9d

@ -4,7 +4,15 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="741ceb24-e493-47c1-9f25-1dbd8b151381" name="Changes" comment="Project Setup" /> <list default="true" id="741ceb24-e493-47c1-9f25-1dbd8b151381" name="Changes" comment="Added intellij files... for better or for worse">
<change afterPath="$PROJECT_DIR$/src/main/kotlin/Pathfinder.kt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/kotlin/Tile.kt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/kotlin/Walls.kt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/kotlin/World.kt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/kotlin/TestingClassTest.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/kotlin/Main.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/Main.kt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -15,6 +23,16 @@
<ProjectState /> <ProjectState />
</projectState> </projectState>
</component> </component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="JUnit5 Test Class" />
<option value="Kotlin Class" />
<option value="Kotlin Data Class" />
<option value="Kotlin Enum" />
</list>
</option>
</component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
@ -27,14 +45,82 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;Gradle.Build HierarchicalPathfinding.executor&quot;: &quot;Run&quot;,
"git-widget-placeholder": "main", &quot;Gradle.TestingClassTest.basic.executor&quot;: &quot;Run&quot;,
"kotlin-language-version-configured": "true", &quot;Gradle.Tests in 'HierarchicalPathfinding.test'.executor&quot;: &quot;Run&quot;,
"settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings" &quot;Kotlin.MainKt.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary&quot;: &quot;JUnit5&quot;,
&quot;com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit5&quot;: &quot;&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;reference.settingsdialog.project.gradle&quot;
} }
}]]></component> }</component>
<component name="RecentsManager">
<key name="CreateTestDialog.Recents.Supers">
<recent name="" />
</key>
<key name="CreateTestDialog.RecentsKey">
<recent name="" />
</key>
</component>
<component name="RunManager" selected="Gradle.TestingClassTest.basic">
<configuration name="TestingClassTest.basic" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;TestingClassTest.basic&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<configuration name="Tests in 'HierarchicalPathfinding.test'" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Gradle.TestingClassTest.basic" />
<item itemvalue="Gradle.Tests in 'HierarchicalPathfinding.test'" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
@ -52,7 +138,23 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1728574886193</updated> <updated>1728574886193</updated>
</task> </task>
<option name="localTasksCounter" value="2" /> <task id="LOCAL-00002" summary="Project Setup 2">
<option name="closed" value="true" />
<created>1728574950416</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1728574950416</updated>
</task>
<task id="LOCAL-00003" summary="Added intellij files... for better or for worse">
<option name="closed" value="true" />
<created>1728575379269</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1728575379269</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -70,7 +172,19 @@
</entry> </entry>
<entry key="MAIN"> <entry key="MAIN">
<value> <value>
<State /> <State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="main" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value> </value>
</entry> </entry>
</map> </map>
@ -81,6 +195,8 @@
<path value="$PROJECT_DIR$" /> <path value="$PROJECT_DIR$" />
</ignored-roots> </ignored-roots>
<MESSAGE value="Project Setup" /> <MESSAGE value="Project Setup" />
<option name="LAST_COMMIT_MESSAGE" value="Project Setup" /> <MESSAGE value="Project Setup 2" />
<MESSAGE value="Added intellij files... for better or for worse" />
<option name="LAST_COMMIT_MESSAGE" value="Added intellij files... for better or for worse" />
</component> </component>
</project> </project>

@ -1,5 +1,14 @@
package technology.zim package technology.zim
/*
Adjacency matrix for graph representation. 5k x 5k or 10k x 10k are safe goals, for memory
Working with a gigantic grid that's mostly full: better to have a up/right/down/left data in each one or a huge adjacency matrix?
Minimum int size is probably 32 or 64 bit, so huge memory waste if that's used
Abandon fancy stretch goals, just get pathfinding done and scale it up to demonstrate large scale
*/
fun main() { fun main() {
println("Hello World!") println("Hello World!")
} }

@ -0,0 +1,5 @@
package technology.zim
class Pathfinder {
}

@ -0,0 +1,7 @@
package technology.zim
class TestingClass {
fun basic(): Boolean {
return true
}
}

@ -0,0 +1,13 @@
package technology.zim
//Data holder to encapsulate a particular location
//Might not be necessary, might add unnecessary memory usage
//Tile could use a simple int or long to combine both coordinates
//Retrieve X or Y with bitwise operations
//Removes boxing while allowing access. Still doesn't add walls.
@JvmInline
value class Tile(val coords: Int) {
}

@ -0,0 +1,7 @@
package technology.zim
//Should change things around so an inline class holds the data and functions for wall checks
enum class Walls(val dirs: Int) {
NORTH(1), EAST(2), SOUTH(4), WEST(8)
}

@ -0,0 +1,23 @@
package technology.zim
//For now, keep it small with uncompresed tile representation
//In the future, this could be stored in a gzipped file and memory mapped
//Location in array is the tile's coordinates
//Value of int is barriers, bitwise operation
class World(val tiles: ArrayList<ArrayList<Walls>> ) {
//TODO: Implement world generation algorithm
fun generate(seed: Int) {
}
//Determine whether moving from one tile to another is valid
//Should limit to adjacent tiles
//Should detect walls and refuse movement if one exists in the desired direction
//Or maybe this should be delegated to another class
fun canPass(x: Int, y: Int, fromX: Int, fromY: Int) {
}
}

@ -0,0 +1,14 @@
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
import technology.zim.TestingClass
class TestingClassTest {
@Test
fun basic() {
val test = TestingClass()
val res = test.basic()
assertEquals(true, res)
}
}
Loading…
Cancel
Save