Skip to content

Commit

Permalink
Apply some minor changes to data convention to adapt for the rewrite …
Browse files Browse the repository at this point in the history
…of react front-end.
  • Loading branch information
kokoro-aya committed Apr 19, 2022
1 parent 41f5711 commit 53b8f13
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 31 deletions.
16 changes: 0 additions & 16 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/simulatte.iml

This file was deleted.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ own client to communicate with the server.

**Warning**: The project is still in development and has great tons of bugs.

For usage with the unity front-end developed last year, use the 3.3 version downloadable in release column. This project
itself has been changed, so it's no longer usable with this front-end.

The currently updated version is suitable to work with the [front-end written in React/UmiJS](https://github.com/kokoro-aya/shizuku-front-end).

This project is part of the Project ironica.

Build with
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

group 'org.ironica'
version "2.10.3-SNAPSHOT"
version "3.4"

sourceCompatibility = 11

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/ironica/simulatte/bridge/LockData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ import kotlinx.serialization.Serializable
import org.ironica.simulatte.playground.datas.Coordinate

@Serializable
data class LockData(val coo: Coordinate, val controlled: List<Coordinate>, val energy: Int = 0)
data class LockData(val coo: Coordinate, val controlled: List<Coordinate>, val isActive: Boolean, val energy: Int = 0)

// TODO implement lock energy and isActive system
2 changes: 1 addition & 1 deletion src/main/kotlin/org/ironica/simulatte/bridge/PortalData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ import org.ironica.simulatte.playground.Color
import org.ironica.simulatte.playground.datas.Coordinate

@Serializable
data class PortalData(val coo: Coordinate, val dest: Coordinate, val color: Color = Color.WHITE, val isActive: Boolean = false)
data class PortalData(val coo: Coordinate, val dest: Coordinate, val color: Color = Color.WHITE, val energy: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class SimulatteBridge(
var lockIds = 0 // To distinguish different locks with the same controlled platforms (and eventually same colors)
var portalIds = 0 // To distinguish different portals

portals = portaldatas.associate { PortalItem(portalIds++, it.coo, it.dest, color = Color.WHITE, energy = if (it.isActive) 10 else 0) to it.coo }
portals = portaldatas.associate { PortalItem(portalIds++, it.coo, it.dest, color = it.color, energy = it.energy) to it.coo }
// TODO add colors on portals
locks = lockdatas.associate { it.coo to LockBlock(lockIds++, it.controlled.toMutableList(), isActive = true, energy = 15) }
locks = lockdatas.associate { it.coo to LockBlock(lockIds++, it.controlled.toMutableList(), isActive = it.isActive, energy = it.energy) }

players = playerdatas.associate {
val coo = Coordinate(it.x, it.y)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ interface AbstractManager {
this.id, x, y, this.dir,
if (this is InstantializedSpecialist) Role.SPECIALIST else Role.PLAYER,
this.stamina,
this.collectedGem,
this.beeperInBag,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ import org.ironica.simulatte.playground.Direction
import org.ironica.simulatte.playground.Role

@Serializable
data class SerializedPlayer(val id: Int, val x: Int, val y: Int, val dir: Direction, val role: Role, val stamina: Int)
data class SerializedPlayer(val id: Int, val x: Int, val y: Int, val dir: Direction, val role: Role, val stamina: Int, val collectedGem: Int, val hasBeeper: Int)

0 comments on commit 53b8f13

Please sign in to comment.