-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca882cd
commit 901d578
Showing
15 changed files
with
66 additions
and
57 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
8 changes: 5 additions & 3 deletions
8
domain/src/main/kotlin/tw/waterballsa/gaas/events/EndedGameEvent.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,17 @@ | ||
package tw.waterballsa.gaas.events | ||
|
||
import tw.waterballsa.gaas.domain.Room | ||
import tw.waterballsa.gaas.events.enums.EventMessageType | ||
|
||
class EndedGameEvent( | ||
type: EventMessageType, | ||
val data: Data | ||
) : SocketIoResponseEvent(type) { | ||
) : RoomEvent(type) { | ||
data class Data( | ||
val roomId: String, | ||
val roomId: Room.Id, | ||
) | ||
|
||
|
||
override fun getEventData(): Any = data | ||
|
||
override fun getRoomId(): Room.Id = data.roomId | ||
} |
7 changes: 4 additions & 3 deletions
7
domain/src/main/kotlin/tw/waterballsa/gaas/events/PlayerJoinedRoomEvent.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,22 +1,23 @@ | ||
package tw.waterballsa.gaas.events | ||
|
||
import tw.waterballsa.gaas.domain.Room | ||
import tw.waterballsa.gaas.events.enums.EventMessageType | ||
|
||
class PlayerJoinedRoomEvent( | ||
type: EventMessageType, | ||
val data: Data | ||
) : SocketIoResponseEvent(type) { | ||
) : RoomEvent(type) { | ||
data class Data( | ||
val user: Player, | ||
val roomId: String, | ||
val roomId: Room.Id, | ||
) { | ||
data class Player( | ||
val id: String, | ||
val nickname: String, | ||
) | ||
} | ||
|
||
|
||
override fun getEventData(): Any = data | ||
|
||
override fun getRoomId(): Room.Id = data.roomId | ||
} |
7 changes: 4 additions & 3 deletions
7
domain/src/main/kotlin/tw/waterballsa/gaas/events/PlayerLeavedRoomEvent.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,22 +1,23 @@ | ||
package tw.waterballsa.gaas.events | ||
|
||
import tw.waterballsa.gaas.domain.Room | ||
import tw.waterballsa.gaas.events.enums.EventMessageType | ||
|
||
class PlayerLeavedRoomEvent( | ||
type: EventMessageType, | ||
val data: Data | ||
) : SocketIoResponseEvent(type) { | ||
) : RoomEvent(type) { | ||
data class Data( | ||
val user: Player, | ||
val roomId: String, | ||
val roomId: Room.Id, | ||
) { | ||
data class Player( | ||
val id: String, | ||
val nickname: String, | ||
) | ||
} | ||
|
||
|
||
override fun getEventData(): Any = data | ||
|
||
override fun getRoomId(): Room.Id = data.roomId | ||
} |
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
8 changes: 8 additions & 0 deletions
8
domain/src/main/kotlin/tw/waterballsa/gaas/events/RoomEvent.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,8 @@ | ||
package tw.waterballsa.gaas.events | ||
|
||
import tw.waterballsa.gaas.domain.Room | ||
import tw.waterballsa.gaas.events.enums.EventMessageType | ||
|
||
abstract class RoomEvent(type: EventMessageType) : SocketIOResponseEvent(type) { | ||
abstract fun getRoomId(): Room.Id | ||
} |
7 changes: 7 additions & 0 deletions
7
domain/src/main/kotlin/tw/waterballsa/gaas/events/SocketIOResponseEvent.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,7 @@ | ||
package tw.waterballsa.gaas.events | ||
|
||
import tw.waterballsa.gaas.events.enums.EventMessageType | ||
|
||
abstract class SocketIOResponseEvent(val type: EventMessageType) : DomainEvent() { | ||
abstract fun getEventData(): Any | ||
} |
5 changes: 0 additions & 5 deletions
5
domain/src/main/kotlin/tw/waterballsa/gaas/events/SocketIoResponseData.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
domain/src/main/kotlin/tw/waterballsa/gaas/events/SocketIoResponseEvent.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
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