Browse Source

rename packages, fullscreen jframe

master
James Fenn 1 year ago
parent
commit
31f320b902
48 changed files with 192 additions and 186 deletions
  1. +1
    -1
      android-sample/src/main/AndroidManifest.xml
  2. +0
    -1
      core/build.gradle
  3. +0
    -12
      core/src/main/java/dev/horrific/dungeon/core/graphics/Sprite.kt
  4. +0
    -17
      core/src/main/java/dev/horrific/dungeon/core/graphics/render/RenderEngine.kt
  5. +0
    -5
      core/src/main/java/dev/horrific/dungeon/core/vector/iterator/VectorIterator.kt
  6. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/Environment.kt
  7. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/color/Color.kt
  8. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/color/RGBColor.kt
  9. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/extensions/AliasDelegate.kt
  10. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/extensions/Color.kt
  11. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/extensions/Number.kt
  12. +6
    -6
      core/src/main/java/me/jfenn/dungeon/core/file/MapParser.kt
  13. +8
    -9
      core/src/main/java/me/jfenn/dungeon/core/graphics/Luminance.kt
  14. +12
    -0
      core/src/main/java/me/jfenn/dungeon/core/graphics/Sprite.kt
  15. +4
    -4
      core/src/main/java/me/jfenn/dungeon/core/graphics/SpriteGroup.kt
  16. +6
    -6
      core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/LuminousPixel.kt
  17. +4
    -4
      core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/Pixel.kt
  18. +8
    -8
      core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/PixelGroup.kt
  19. +14
    -14
      core/src/main/java/me/jfenn/dungeon/core/graphics/render/DynamicRenderEngine.kt
  20. +17
    -0
      core/src/main/java/me/jfenn/dungeon/core/graphics/render/RenderEngine.kt
  21. +3
    -4
      core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialCollection.kt
  22. +4
    -4
      core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialMap.kt
  23. +2
    -3
      core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialObject.kt
  24. +3
    -3
      core/src/main/java/me/jfenn/dungeon/core/vector/AreaFactory.kt
  25. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/vector/DoubleVector.kt
  26. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/vector/FloatVector.kt
  27. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/vector/IntVector.kt
  28. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/vector/MutableVector.kt
  29. +2
    -2
      core/src/main/java/me/jfenn/dungeon/core/vector/Vector.kt
  30. +1
    -1
      core/src/main/java/me/jfenn/dungeon/core/vector/VectorFactory.kt
  31. +2
    -2
      core/src/main/java/me/jfenn/dungeon/core/vector/area/Area.kt
  32. +3
    -3
      core/src/main/java/me/jfenn/dungeon/core/vector/area/LineArea.kt
  33. +2
    -2
      core/src/main/java/me/jfenn/dungeon/core/vector/area/ListArea.kt
  34. +5
    -6
      core/src/main/java/me/jfenn/dungeon/core/vector/area/RadiusArea.kt
  35. +4
    -4
      core/src/main/java/me/jfenn/dungeon/core/vector/area/RectArea.kt
  36. +2
    -2
      core/src/main/java/me/jfenn/dungeon/core/vector/area/StaticArea.kt
  37. +3
    -3
      core/src/main/java/me/jfenn/dungeon/core/vector/iterator/AreaIterator.kt
  38. +5
    -0
      core/src/main/java/me/jfenn/dungeon/core/vector/iterator/VectorIterator.kt
  39. +3
    -3
      core/src/main/java/me/jfenn/dungeon/core/view/DungeonView.kt
  40. +1
    -1
      core/src/test/java/me/jfenn/dungeon/core/ExampleUnitTest.kt
  41. +1
    -1
      core/src/test/java/me/jfenn/dungeon/core/vector/Vector2Test.kt
  42. +1
    -1
      core/src/test/java/me/jfenn/dungeon/core/vector/Vector3Test.kt
  43. +2
    -2
      core/src/test/java/me/jfenn/dungeon/core/vector/area/LineTest.kt
  44. +0
    -25
      swing/src/main/java/dev/horrific/dungeon/JDungeonFrame.kt
  45. +4
    -4
      swing/src/main/java/me/jfenn/dungeon/JDungeonCanvas.kt
  46. +37
    -0
      swing/src/main/java/me/jfenn/dungeon/JDungeonFrame.kt
  47. +10
    -11
      swing/src/main/java/me/jfenn/dungeon/Main.kt
  48. +2
    -2
      swing/src/main/java/me/jfenn/dungeon/TestCanvas.kt

+ 1
- 1
android-sample/src/main/AndroidManifest.xml View File

@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.horrific.dungeonsample">
package="me.jfenn.dungeonsample">

<application android:allowBackup="true"
android:label="@string/app_name"


+ 0
- 1
core/build.gradle View File

@@ -1,4 +1,3 @@
apply plugin: 'java-library'
apply plugin: 'kotlin'

compileKotlin {


+ 0
- 12
core/src/main/java/dev/horrific/dungeon/core/graphics/Sprite.kt View File

@@ -1,12 +0,0 @@
package dev.horrific.dungeon.core.graphics

import dev.horrific.dungeon.core.graphics.pixel.LuminousPixel
import dev.horrific.dungeon.core.graphics.pixel.PixelGroup
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.spatial.SpatialMap
import dev.horrific.dungeon.core.vector.MutableIntVector

open class Sprite(
pixels: SpatialCollection<LuminousPixel> = SpatialMap(),
position: MutableIntVector = MutableIntVector(0, 0)
): PixelGroup(pixels, position)

+ 0
- 17
core/src/main/java/dev/horrific/dungeon/core/graphics/render/RenderEngine.kt View File

@@ -1,17 +0,0 @@
package dev.horrific.dungeon.core.graphics.render

import dev.horrific.dungeon.core.color.Color
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.area.Area
import dev.horrific.dungeon.core.view.DungeonView

interface RenderEngine {

fun onChange(area: Area<IntVector>? = null)

fun render(): SpatialCollection<Color>

fun subscribe(view: DungeonView?)

}

+ 0
- 5
core/src/main/java/dev/horrific/dungeon/core/vector/iterator/VectorIterator.kt View File

@@ -1,5 +0,0 @@
package dev.horrific.dungeon.core.vector.iterator

import dev.horrific.dungeon.core.vector.Vector

interface VectorIterator<V: Vector<*>>: Iterator<V>

core/src/main/java/dev/horrific/dungeon/core/Environment.kt → core/src/main/java/me/jfenn/dungeon/core/Environment.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core
package me.jfenn.dungeon.core

data class Environment(
var drawDynamicLighting: Boolean = true

core/src/main/java/dev/horrific/dungeon/core/color/Color.kt → core/src/main/java/me/jfenn/dungeon/core/color/Color.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.color
package me.jfenn.dungeon.core.color

import kotlin.math.roundToInt


core/src/main/java/dev/horrific/dungeon/core/color/RGBColor.kt → core/src/main/java/me/jfenn/dungeon/core/color/RGBColor.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.color
package me.jfenn.dungeon.core.color

open class RGBColor(
open var red: Int,

core/src/main/java/dev/horrific/dungeon/core/extensions/AliasDelegate.kt → core/src/main/java/me/jfenn/dungeon/core/extensions/AliasDelegate.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.extensions
package me.jfenn.dungeon.core.extensions

import kotlin.reflect.KMutableProperty0
import kotlin.reflect.KProperty

core/src/main/java/dev/horrific/dungeon/core/extensions/Color.kt → core/src/main/java/me/jfenn/dungeon/core/extensions/Color.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.extensions
package me.jfenn.dungeon.core.extensions

/*
Unused (old) code:

core/src/main/java/dev/horrific/dungeon/core/extensions/Number.kt → core/src/main/java/me/jfenn/dungeon/core/extensions/Number.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.extensions
package me.jfenn.dungeon.core.extensions

fun <T: Number> typeNum(num: Number, other: T): T {
return when (other) {

core/src/main/java/dev/horrific/dungeon/core/file/MapParser.kt → core/src/main/java/me/jfenn/dungeon/core/file/MapParser.kt View File

@@ -1,10 +1,10 @@
package dev.horrific.dungeon.core.file
package me.jfenn.dungeon.core.file

import dev.horrific.dungeon.core.color.RGBColor
import dev.horrific.dungeon.core.graphics.Luminance
import dev.horrific.dungeon.core.graphics.pixel.LuminousPixel
import dev.horrific.dungeon.core.spatial.SpatialMap
import dev.horrific.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.color.RGBColor
import me.jfenn.dungeon.core.graphics.Luminance
import me.jfenn.dungeon.core.graphics.pixel.LuminousPixel
import me.jfenn.dungeon.core.spatial.SpatialMap
import me.jfenn.dungeon.core.vector.MutableIntVector
import java.lang.RuntimeException

const val BLOCK_MAP = "[map]"

core/src/main/java/dev/horrific/dungeon/core/graphics/Luminance.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/Luminance.kt View File

@@ -1,13 +1,12 @@
package dev.horrific.dungeon.core.graphics
package me.jfenn.dungeon.core.graphics

import dev.horrific.dungeon.core.color.RGBColor
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.spatial.SpatialMap
import dev.horrific.dungeon.core.spatial.SpatialObject
import dev.horrific.dungeon.core.vector.*
import dev.horrific.dungeon.core.vector.area.Area
import dev.horrific.dungeon.core.vector.area.LineArea
import dev.horrific.dungeon.core.vector.area.StaticArea
import me.jfenn.dungeon.core.color.RGBColor
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.spatial.SpatialObject
import me.jfenn.dungeon.core.vector.*
import me.jfenn.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.vector.area.LineArea
import me.jfenn.dungeon.core.vector.area.StaticArea
import kotlin.math.ceil

class Luminance(

+ 12
- 0
core/src/main/java/me/jfenn/dungeon/core/graphics/Sprite.kt View File

@@ -0,0 +1,12 @@
package me.jfenn.dungeon.core.graphics

import me.jfenn.dungeon.core.graphics.pixel.LuminousPixel
import me.jfenn.dungeon.core.graphics.pixel.PixelGroup
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.spatial.SpatialMap
import me.jfenn.dungeon.core.vector.MutableIntVector

open class Sprite(
pixels: SpatialCollection<LuminousPixel> = SpatialMap(),
position: MutableIntVector = MutableIntVector(0, 0)
): PixelGroup(pixels, position)

core/src/main/java/dev/horrific/dungeon/core/graphics/SpriteGroup.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/SpriteGroup.kt View File

@@ -1,8 +1,8 @@
package dev.horrific.dungeon.core.graphics
package me.jfenn.dungeon.core.graphics

import dev.horrific.dungeon.core.graphics.pixel.LuminousPixel
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.spatial.SpatialMap
import me.jfenn.dungeon.core.graphics.pixel.LuminousPixel
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.spatial.SpatialMap

class SpriteGroup: Sprite() {


core/src/main/java/dev/horrific/dungeon/core/graphics/pixel/LuminousPixel.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/LuminousPixel.kt View File

@@ -1,10 +1,10 @@
package dev.horrific.dungeon.core.graphics.pixel
package me.jfenn.dungeon.core.graphics.pixel

import dev.horrific.dungeon.core.color.RGBColor
import dev.horrific.dungeon.core.graphics.Luminance
import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.MutableIntVector
import dev.horrific.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.color.RGBColor
import me.jfenn.dungeon.core.graphics.Luminance
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.vector.area.Area

class LuminousPixel(
override var color: RGBColor,

core/src/main/java/dev/horrific/dungeon/core/graphics/pixel/Pixel.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/Pixel.kt View File

@@ -1,8 +1,8 @@
package dev.horrific.dungeon.core.graphics.pixel
package me.jfenn.dungeon.core.graphics.pixel

import dev.horrific.dungeon.core.color.Color
import dev.horrific.dungeon.core.spatial.SpatialObject
import dev.horrific.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.color.Color
import me.jfenn.dungeon.core.spatial.SpatialObject
import me.jfenn.dungeon.core.vector.IntVector

interface Pixel<C: Color>: SpatialObject {


core/src/main/java/dev/horrific/dungeon/core/graphics/pixel/PixelGroup.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/pixel/PixelGroup.kt View File

@@ -1,12 +1,12 @@
package dev.horrific.dungeon.core.graphics.pixel
package me.jfenn.dungeon.core.graphics.pixel

import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.spatial.SpatialMap
import dev.horrific.dungeon.core.spatial.SpatialObject
import dev.horrific.dungeon.core.spatial.add
import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.MutableIntVector
import dev.horrific.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.spatial.SpatialMap
import me.jfenn.dungeon.core.spatial.SpatialObject
import me.jfenn.dungeon.core.spatial.add
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.vector.area.Area

open class PixelGroup (
open val pixels: SpatialCollection<LuminousPixel> = SpatialMap(),

core/src/main/java/dev/horrific/dungeon/core/graphics/render/DynamicRenderEngine.kt → core/src/main/java/me/jfenn/dungeon/core/graphics/render/DynamicRenderEngine.kt View File

@@ -1,17 +1,17 @@
package dev.horrific.dungeon.core.graphics.render
import dev.horrific.dungeon.core.Environment
import dev.horrific.dungeon.core.color.Color
import dev.horrific.dungeon.core.graphics.Luminance
import dev.horrific.dungeon.core.graphics.Sprite
import dev.horrific.dungeon.core.graphics.pixel.LuminousPixel
import dev.horrific.dungeon.core.graphics.pixel.PixelGroup
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.spatial.SpatialMap
import dev.horrific.dungeon.core.spatial.add
import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.area.Area
import dev.horrific.dungeon.core.view.DungeonView
package me.jfenn.dungeon.core.graphics.render
import me.jfenn.dungeon.core.Environment
import me.jfenn.dungeon.core.color.Color
import me.jfenn.dungeon.core.graphics.Luminance
import me.jfenn.dungeon.core.graphics.Sprite
import me.jfenn.dungeon.core.graphics.pixel.LuminousPixel
import me.jfenn.dungeon.core.graphics.pixel.PixelGroup
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.spatial.SpatialMap
import me.jfenn.dungeon.core.spatial.add
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.view.DungeonView

class DynamicRenderEngine(
val env: Environment

+ 17
- 0
core/src/main/java/me/jfenn/dungeon/core/graphics/render/RenderEngine.kt View File

@@ -0,0 +1,17 @@
package me.jfenn.dungeon.core.graphics.render

import me.jfenn.dungeon.core.color.Color
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.view.DungeonView

interface RenderEngine {

fun onChange(area: Area<IntVector>? = null)

fun render(): SpatialCollection<Color>

fun subscribe(view: DungeonView?)

}

core/src/main/java/dev/horrific/dungeon/core/spatial/SpatialCollection.kt → core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialCollection.kt View File

@@ -1,8 +1,7 @@
package dev.horrific.dungeon.core.spatial
package me.jfenn.dungeon.core.spatial

import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.area.Area
import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.area.Area

interface SpatialCollection<T>: Collection<T>, SpatialObject {


core/src/main/java/dev/horrific/dungeon/core/spatial/SpatialMap.kt → core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialMap.kt View File

@@ -1,8 +1,8 @@
package dev.horrific.dungeon.core.spatial
package me.jfenn.dungeon.core.spatial

import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.MutableIntVector
import dev.horrific.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.vector.area.Area
import kotlin.collections.HashMap

class SpatialMap<T>(): SpatialCollection<T> {

core/src/main/java/dev/horrific/dungeon/core/spatial/SpatialObject.kt → core/src/main/java/me/jfenn/dungeon/core/spatial/SpatialObject.kt View File

@@ -1,7 +1,6 @@
package dev.horrific.dungeon.core.spatial
package me.jfenn.dungeon.core.spatial

import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.IntVector

interface SpatialObject {


core/src/main/java/dev/horrific/dungeon/core/vector/AreaFactory.kt → core/src/main/java/me/jfenn/dungeon/core/vector/AreaFactory.kt View File

@@ -1,7 +1,7 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

import dev.horrific.dungeon.core.vector.area.RadiusArea
import dev.horrific.dungeon.core.vector.area.RectArea
import me.jfenn.dungeon.core.vector.area.RadiusArea
import me.jfenn.dungeon.core.vector.area.RectArea

interface AreaFactory<T: Number, V: Vector<T>> {


core/src/main/java/dev/horrific/dungeon/core/vector/DoubleVector.kt → core/src/main/java/me/jfenn/dungeon/core/vector/DoubleVector.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

abstract class DoubleVector: Vector<Double>(), AreaFactory<Double, DoubleVector>


core/src/main/java/dev/horrific/dungeon/core/vector/FloatVector.kt → core/src/main/java/me/jfenn/dungeon/core/vector/FloatVector.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

abstract class FloatVector: Vector<Float>(), AreaFactory<Float, FloatVector>


core/src/main/java/dev/horrific/dungeon/core/vector/IntVector.kt → core/src/main/java/me/jfenn/dungeon/core/vector/IntVector.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

abstract class IntVector: Vector<Int>(), AreaFactory<Int, IntVector> {


core/src/main/java/dev/horrific/dungeon/core/vector/MutableVector.kt → core/src/main/java/me/jfenn/dungeon/core/vector/MutableVector.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

open class MutableVector<T: Number>(
override var x: T,

core/src/main/java/dev/horrific/dungeon/core/vector/Vector.kt → core/src/main/java/me/jfenn/dungeon/core/vector/Vector.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

import dev.horrific.dungeon.core.extensions.*
import me.jfenn.dungeon.core.extensions.*

abstract class Vector<T: Number>: Comparable<Vector<T>>, VectorFactory {


core/src/main/java/dev/horrific/dungeon/core/vector/VectorFactory.kt → core/src/main/java/me/jfenn/dungeon/core/vector/VectorFactory.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

interface VectorFactory {


core/src/main/java/dev/horrific/dungeon/core/vector/area/Area.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/Area.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.Vector

interface Area<T: Vector<*>>: Collection<T> {


core/src/main/java/dev/horrific/dungeon/core/vector/area/LineArea.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/LineArea.kt View File

@@ -1,7 +1,7 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.*
import dev.horrific.dungeon.core.vector.iterator.AreaIterator
import me.jfenn.dungeon.core.vector.*
import me.jfenn.dungeon.core.vector.iterator.AreaIterator
import java.lang.RuntimeException

class LineArea(

core/src/main/java/dev/horrific/dungeon/core/vector/area/ListArea.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/ListArea.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.Vector

class ListArea<T: Number, V: Vector<T>>(): Area<V> {


core/src/main/java/dev/horrific/dungeon/core/vector/area/RadiusArea.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/RadiusArea.kt View File

@@ -1,10 +1,9 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.IntVector
import dev.horrific.dungeon.core.vector.MutableIntVector
import dev.horrific.dungeon.core.vector.MutableVector
import dev.horrific.dungeon.core.vector.Vector
import dev.horrific.dungeon.core.vector.iterator.AreaIterator
import me.jfenn.dungeon.core.vector.IntVector
import me.jfenn.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.iterator.AreaIterator
import kotlin.math.*

class RadiusArea(

core/src/main/java/dev/horrific/dungeon/core/vector/area/RectArea.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/RectArea.kt View File

@@ -1,8 +1,8 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.extensions.*
import dev.horrific.dungeon.core.vector.Vector
import dev.horrific.dungeon.core.vector.iterator.AreaIterator
import me.jfenn.dungeon.core.extensions.*
import me.jfenn.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.iterator.AreaIterator

abstract class RectArea<T: Number, V: Vector<T>>(
val position: V,

core/src/main/java/dev/horrific/dungeon/core/vector/area/StaticArea.kt → core/src/main/java/me/jfenn/dungeon/core/vector/area/StaticArea.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.Vector
import java.lang.RuntimeException

class StaticArea<T: Vector<*>>(

core/src/main/java/dev/horrific/dungeon/core/vector/iterator/AreaIterator.kt → core/src/main/java/me/jfenn/dungeon/core/vector/iterator/AreaIterator.kt View File

@@ -1,7 +1,7 @@
package dev.horrific.dungeon.core.vector.iterator
package me.jfenn.dungeon.core.vector.iterator

import dev.horrific.dungeon.core.vector.area.Area
import dev.horrific.dungeon.core.vector.Vector
import me.jfenn.dungeon.core.vector.area.Area
import me.jfenn.dungeon.core.vector.Vector

class AreaIterator<V: Vector<*>>(
val area: Area<V>

+ 5
- 0
core/src/main/java/me/jfenn/dungeon/core/vector/iterator/VectorIterator.kt View File

@@ -0,0 +1,5 @@
package me.jfenn.dungeon.core.vector.iterator

import me.jfenn.dungeon.core.vector.Vector

interface VectorIterator<V: Vector<*>>: Iterator<V>

core/src/main/java/dev/horrific/dungeon/core/view/DungeonView.kt → core/src/main/java/me/jfenn/dungeon/core/view/DungeonView.kt View File

@@ -1,7 +1,7 @@
package dev.horrific.dungeon.core.view
package me.jfenn.dungeon.core.view

import dev.horrific.dungeon.core.color.Color
import dev.horrific.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.color.Color
import me.jfenn.dungeon.core.spatial.SpatialCollection

interface DungeonView {


core/src/test/java/dev/horrific/dungeon/core/ExampleUnitTest.kt → core/src/test/java/me/jfenn/dungeon/core/ExampleUnitTest.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core
package me.jfenn.dungeon.core

import org.junit.Test


core/src/test/java/dev/horrific/dungeon/core/vector/Vector2Test.kt → core/src/test/java/me/jfenn/dungeon/core/vector/Vector2Test.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

import org.junit.Test


core/src/test/java/dev/horrific/dungeon/core/vector/Vector3Test.kt → core/src/test/java/me/jfenn/dungeon/core/vector/Vector3Test.kt View File

@@ -1,4 +1,4 @@
package dev.horrific.dungeon.core.vector
package me.jfenn.dungeon.core.vector

import org.junit.Test


core/src/test/java/dev/horrific/dungeon/core/vector/area/LineTest.kt → core/src/test/java/me/jfenn/dungeon/core/vector/area/LineTest.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon.core.vector.area
package me.jfenn.dungeon.core.vector.area

import dev.horrific.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.vector.MutableIntVector
import org.junit.Test

class LineTest {

+ 0
- 25
swing/src/main/java/dev/horrific/dungeon/JDungeonFrame.kt View File

@@ -1,25 +0,0 @@
package dev.horrific.dungeon

import dev.horrific.dungeon.core.graphics.render.RenderEngine
import javax.swing.JFrame

class JDungeonFrame(
val env: RenderEngine
): JFrame() {

init {
title = "aaaaaaaaaaa"
setSize(800, 800)
setLocationRelativeTo(null)
defaultCloseOperation = EXIT_ON_CLOSE

val canvas = TestCanvas(env)
canvas.setBounds(0, 0, 800, 800)
add(canvas)

env.subscribe(canvas)
env.onChange()
}


}

swing/src/main/java/dev/horrific/dungeon/JDungeonCanvas.kt → swing/src/main/java/me/jfenn/dungeon/JDungeonCanvas.kt View File

@@ -1,8 +1,8 @@
package dev.horrific.dungeon
package me.jfenn.dungeon

import dev.horrific.dungeon.core.color.Color
import dev.horrific.dungeon.core.spatial.SpatialCollection
import dev.horrific.dungeon.core.view.DungeonView
import me.jfenn.dungeon.core.color.Color
import me.jfenn.dungeon.core.spatial.SpatialCollection
import me.jfenn.dungeon.core.view.DungeonView
import java.awt.Graphics
import javax.swing.JComponent


+ 37
- 0
swing/src/main/java/me/jfenn/dungeon/JDungeonFrame.kt View File

@@ -0,0 +1,37 @@
package me.jfenn.dungeon

import me.jfenn.dungeon.core.graphics.render.RenderEngine
import java.awt.Frame
import java.awt.GraphicsEnvironment
import java.awt.Window
import javax.swing.JFrame


class JDungeonFrame(
val env: RenderEngine
): JFrame() {

init {
title = "aaaaaaaaaaa"
extendedState = Frame.MAXIMIZED_BOTH
isResizable = true
isUndecorated = true
setLocationRelativeTo(null)
defaultCloseOperation = EXIT_ON_CLOSE

val canvas = TestCanvas(env)
canvas.setBounds(0, 0, 800, 800)
add(canvas)

env.subscribe(canvas)
env.onChange()

for (w in Window.getWindows()) {
GraphicsEnvironment.getLocalGraphicsEnvironment().defaultScreenDevice.fullScreenWindow = w
}

isVisible = true
}


}

swing/src/main/java/dev/horrific/dungeon/Main.kt → swing/src/main/java/me/jfenn/dungeon/Main.kt View File

@@ -1,15 +1,14 @@
package dev.horrific.dungeon
package me.jfenn.dungeon

import dev.horrific.dungeon.core.Environment
import dev.horrific.dungeon.core.color.RGBColor
import dev.horrific.dungeon.core.file.MapParser
import dev.horrific.dungeon.core.graphics.Luminance
import dev.horrific.dungeon.core.graphics.Sprite
import dev.horrific.dungeon.core.graphics.pixel.LuminousPixel
import dev.horrific.dungeon.core.graphics.render.DynamicRenderEngine
import dev.horrific.dungeon.core.spatial.add
import dev.horrific.dungeon.core.spatial.addAll
import dev.horrific.dungeon.core.vector.MutableIntVector
import me.jfenn.dungeon.core.Environment
import me.jfenn.dungeon.core.color.RGBColor
import me.jfenn.dungeon.core.file.MapParser
import me.jfenn.dungeon.core.graphics.Luminance
import me.jfenn.dungeon.core.graphics.Sprite
import me.jfenn.dungeon.core.graphics.render.DynamicRenderEngine
import me.jfenn.dungeon.core.spatial.add
import me.jfenn.dungeon.core.spatial.addAll
import me.jfenn.dungeon.core.vector.MutableIntVector

val background = MapParser().parse("""
[map]

swing/src/main/java/dev/horrific/dungeon/TestCanvas.kt → swing/src/main/java/me/jfenn/dungeon/TestCanvas.kt View File

@@ -1,6 +1,6 @@
package dev.horrific.dungeon
package me.jfenn.dungeon

import dev.horrific.dungeon.core.graphics.render.RenderEngine
import me.jfenn.dungeon.core.graphics.render.RenderEngine
import java.awt.event.MouseEvent
import java.awt.event.MouseMotionListener


Loading…
Cancel
Save