Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched entities to data classes removing TileSystem.kts closes #18
Switched Tile to an inline class closing #46
- Loading branch information
Showing
22 changed files
with
54 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
engine/src/main/kotlin/org/redrune/engine/entity/model/Entity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* An identifiable object with a physical spatial location | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
interface Entity { | ||
val id: Int | ||
var tile: Tile | ||
} |
4 changes: 3 additions & 1 deletion
4
engine/src/main/kotlin/org/redrune/engine/entity/model/FloorItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* An [Item] with physical location | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
data class FloorItem(override val id: Int) : Entity | ||
data class FloorItem(override val id: Int, override var tile: Tile) : Entity |
4 changes: 3 additions & 1 deletion
4
engine/src/main/kotlin/org/redrune/engine/entity/model/IObject.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* Interactive Object | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
data class IObject(override val id: Int) : Entity | ||
data class IObject(override val id: Int, override var tile: Tile) : Entity |
11 changes: 11 additions & 0 deletions
11
engine/src/main/kotlin/org/redrune/engine/entity/model/Movable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since April 03, 2020 | ||
*/ | ||
interface Movable { | ||
val tile: Tile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* A non-player character | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
data class NPC(override val id: Int) : Entity | ||
data class NPC(override val id: Int, override var tile: Tile) : Entity |
6 changes: 5 additions & 1 deletion
6
engine/src/main/kotlin/org/redrune/engine/entity/model/Player.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* A player controlled by client or bot | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
data class Player(override val id: Int) : Entity | ||
data class Player(override var id: Int, override var tile: Tile) : Entity, Movable { | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
engine/src/main/kotlin/org/redrune/engine/entity/model/Projectile.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package org.redrune.engine.entity.model | ||
|
||
import org.redrune.engine.model.Tile | ||
|
||
/** | ||
* @author Greg Hibberd <greg@greghibberd.com> | ||
* @since March 28, 2020 | ||
*/ | ||
data class Projectile(override val id: Int) : Entity | ||
data class Projectile(override val id: Int, override var tile: Tile) : Entity |
24 changes: 0 additions & 24 deletions
24
engine/src/main/kotlin/org/redrune/engine/entity/tile/TileList.kt
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
engine/src/main/kotlin/org/redrune/engine/entity/tile/TileSystem.kts
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
engine/src/main/kotlin/org/redrune/engine/entity/tile/Tiles.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.