-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert context to use generics/dynamic characters #466
- Loading branch information
Showing
139 changed files
with
666 additions
and
594 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
engine/src/main/kotlin/world/gregs/voidps/engine/client/ui/InterfaceOption.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
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
9 changes: 6 additions & 3 deletions
9
engine/src/main/kotlin/world/gregs/voidps/engine/client/ui/interact/ItemOnNPC.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
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
5 changes: 3 additions & 2 deletions
5
...e/src/main/kotlin/world/gregs/voidps/engine/entity/character/mode/interact/Interaction.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,15 +1,16 @@ | ||
package world.gregs.voidps.engine.entity.character.mode.interact | ||
|
||
import world.gregs.voidps.engine.entity.character.Character | ||
import world.gregs.voidps.engine.entity.character.CharacterContext | ||
import world.gregs.voidps.engine.event.CancellableEvent | ||
import world.gregs.voidps.engine.event.SuspendableEvent | ||
|
||
abstract class Interaction : CancellableEvent(), SuspendableEvent, CharacterContext { | ||
abstract class Interaction<C: Character> : CancellableEvent(), SuspendableEvent, CharacterContext<C> { | ||
var approach = false | ||
val operate: Boolean | ||
get() = !approach | ||
override var onCancel: (() -> Unit)? = null | ||
var launched = false | ||
|
||
abstract fun copy(approach: Boolean): Interaction | ||
abstract fun copy(approach: Boolean): Interaction<C> | ||
} |
3 changes: 2 additions & 1 deletion
3
...kotlin/world/gregs/voidps/engine/entity/character/mode/interact/TargetFloorItemContext.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,9 @@ | ||
package world.gregs.voidps.engine.entity.character.mode.interact | ||
|
||
import world.gregs.voidps.engine.entity.character.Character | ||
import world.gregs.voidps.engine.entity.character.CharacterContext | ||
import world.gregs.voidps.engine.entity.item.floor.FloorItem | ||
|
||
interface TargetFloorItemContext : CharacterContext { | ||
interface TargetFloorItemContext<C: Character> : CharacterContext<C> { | ||
val target: FloorItem | ||
} |
3 changes: 2 additions & 1 deletion
3
.../main/kotlin/world/gregs/voidps/engine/entity/character/mode/interact/TargetNPCContext.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,9 @@ | ||
package world.gregs.voidps.engine.entity.character.mode.interact | ||
|
||
import world.gregs.voidps.engine.entity.character.Character | ||
import world.gregs.voidps.engine.entity.character.CharacterContext | ||
import world.gregs.voidps.engine.entity.character.npc.NPC | ||
|
||
interface TargetNPCContext : CharacterContext { | ||
interface TargetNPCContext<C: Character> : CharacterContext<C> { | ||
val target: NPC | ||
} |
3 changes: 2 additions & 1 deletion
3
...in/kotlin/world/gregs/voidps/engine/entity/character/mode/interact/TargetObjectContext.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,9 @@ | ||
package world.gregs.voidps.engine.entity.character.mode.interact | ||
|
||
import world.gregs.voidps.engine.entity.character.Character | ||
import world.gregs.voidps.engine.entity.character.CharacterContext | ||
import world.gregs.voidps.engine.entity.obj.GameObject | ||
|
||
interface TargetObjectContext : CharacterContext { | ||
interface TargetObjectContext<C: Character> : CharacterContext<C> { | ||
val target: GameObject | ||
} |
3 changes: 2 additions & 1 deletion
3
...in/kotlin/world/gregs/voidps/engine/entity/character/mode/interact/TargetPlayerContext.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,9 @@ | ||
package world.gregs.voidps.engine.entity.character.mode.interact | ||
|
||
import world.gregs.voidps.engine.entity.character.Character | ||
import world.gregs.voidps.engine.entity.character.CharacterContext | ||
import world.gregs.voidps.engine.entity.character.player.Player | ||
|
||
interface TargetPlayerContext : CharacterContext { | ||
interface TargetPlayerContext<C: Character> : CharacterContext<C> { | ||
val target: Player | ||
} |
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.