Verified Commit df1eeaec authored by Lars Mitsem Selbekk's avatar Lars Mitsem Selbekk
Browse files

Move all the things

parent 7d659a63
Pipeline #175824 failed with stages
in 12 minutes and 15 seconds
......@@ -26,12 +26,12 @@ import se.battlegoo.battlegoose.network.MultiplayerService
import se.battlegoo.battlegoose.utils.Modal
import se.battlegoo.battlegoose.utils.ModalType
import se.battlegoo.battlegoose.views.BattleMapView
import se.battlegoo.battlegoose.views.BattleView
import se.battlegoo.battlegoose.views.BattleViewObserver
import se.battlegoo.battlegoose.views.FacingDirection
import se.battlegoo.battlegoose.views.UnitSprite
import se.battlegoo.battlegoose.views.UnitStatsView
import se.battlegoo.battlegoose.views.UnitView
import se.battlegoo.battlegoose.views.screens.BattleView
import se.battlegoo.battlegoose.views.screens.BattleViewObserver
import se.battlegoo.battlegoose.views.units.FacingDirection
import se.battlegoo.battlegoose.views.units.UnitSprite
import se.battlegoo.battlegoose.views.units.UnitStatsView
import se.battlegoo.battlegoose.views.units.UnitView
import java.util.concurrent.TimeUnit
import kotlin.math.abs
import kotlin.random.Random
......
......@@ -2,7 +2,7 @@ package se.battlegoo.battlegoose.controllers
import se.battlegoo.battlegoose.views.BattleMapTileState
import se.battlegoo.battlegoose.views.BattleMapTileView
import se.battlegoo.battlegoose.views.ClickObserver
import se.battlegoo.battlegoose.views.utils.ClickObserver
class BattleMapTileController(
private val tileView: BattleMapTileView,
......
package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.views.ViewBase
import se.battlegoo.battlegoose.views.utils.ViewBase
abstract class ControllerBase(private val view: ViewBase) {
abstract fun update(dt: Float)
......
package se.battlegoo.battlegoose.controllers
import se.battlegoo.battlegoose.models.heroes.HeroSelection
import se.battlegoo.battlegoose.views.HeroSelectionView
import se.battlegoo.battlegoose.views.IHeroSelectionViewController
import se.battlegoo.battlegoose.views.screens.HeroSelectionView
import se.battlegoo.battlegoose.views.screens.IHeroSelectionViewController
class HeroSelectionController(
private val view: HeroSelectionView,
......
......@@ -9,7 +9,7 @@ import se.battlegoo.battlegoose.network.JoinLobbyStatus
import se.battlegoo.battlegoose.network.MultiplayerService
import se.battlegoo.battlegoose.utils.Modal
import se.battlegoo.battlegoose.utils.ModalType
import se.battlegoo.battlegoose.views.JoinLobbyView
import se.battlegoo.battlegoose.views.screens.JoinLobbyView
class JoinLobbyController(
hero: Hero,
......
......@@ -8,7 +8,7 @@ import se.battlegoo.battlegoose.network.MultiplayerService
import se.battlegoo.battlegoose.network.RandomPairingStatus
import se.battlegoo.battlegoose.utils.Modal
import se.battlegoo.battlegoose.utils.ModalType
import se.battlegoo.battlegoose.views.QuickJoinView
import se.battlegoo.battlegoose.views.screens.QuickJoinView
class QuickJoinController(
hero: Hero,
......
......@@ -2,9 +2,9 @@ package se.battlegoo.battlegoose.controllers
import se.battlegoo.battlegoose.models.tutorial.Tutorial
import se.battlegoo.battlegoose.models.tutorial.TutorialStep
import se.battlegoo.battlegoose.views.ITutorialViewController
import se.battlegoo.battlegoose.views.TutorialView
import se.battlegoo.battlegoose.views.TutorialViewModel
import se.battlegoo.battlegoose.views.screens.ITutorialViewController
import se.battlegoo.battlegoose.views.screens.TutorialView
import se.battlegoo.battlegoose.views.screens.TutorialViewModel
class TutorialController(
private val view: TutorialView,
......
......@@ -3,8 +3,8 @@ package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.datamodels.ScreenVector
import se.battlegoo.battlegoose.models.units.UnitModel
import se.battlegoo.battlegoose.views.UnitHealthBarView
import se.battlegoo.battlegoose.views.UnitView
import se.battlegoo.battlegoose.views.units.UnitHealthBarView
import se.battlegoo.battlegoose.views.units.UnitView
open class UnitController(
val unitModel: UnitModel,
......
......@@ -3,7 +3,7 @@ package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.datamodels.ScreenVector
import se.battlegoo.battlegoose.models.units.UnitModel
import se.battlegoo.battlegoose.views.UnitHealthBarView
import se.battlegoo.battlegoose.views.units.UnitHealthBarView
class UnitHealthBarController(
private val unitModel: UnitModel,
......
......@@ -2,7 +2,7 @@ package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.models.units.UnitModel
import se.battlegoo.battlegoose.views.UnitStatsView
import se.battlegoo.battlegoose.views.units.UnitStatsView
class UnitStatsController(
unitModel: UnitModel?,
......
......@@ -9,7 +9,7 @@ import se.battlegoo.battlegoose.models.Battle
import se.battlegoo.battlegoose.models.BattleMap
import se.battlegoo.battlegoose.models.BattleMapBackground
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.views.BattleView
import se.battlegoo.battlegoose.views.screens.BattleView
class BattleState(
playerID: String,
......
package se.battlegoo.battlegoose.gamestates
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.controllers.CreateLobbyController
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.views.CreateLobbyView
class CreateLobbyState(selectedHero: Hero) : LobbyState(selectedHero) {
private val createLobbyController: CreateLobbyController = CreateLobbyController(
selectedHero,
createLobbyView = CreateLobbyView(
this::goBack,
stage
),
onClickStartBattle = {
GameStateManager.replace(
BattleState(
it.hostID,
it.battleID,
it.hostHero.toHero(),
it.otherHero!!.toHero(),
true
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage = stage
)
fun goBack() =
createLobbyController.goBack()
override fun update(dt: Float) {
createLobbyController.update(dt)
}
override fun render(sb: SpriteBatch) {
createLobbyController.render(sb)
}
override fun dispose() {
createLobbyController.dispose()
}
}
......@@ -7,8 +7,8 @@ import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.models.heroes.HeroSelection
import se.battlegoo.battlegoose.models.heroes.MajorMallard
import se.battlegoo.battlegoose.models.heroes.SergeantSwan
import se.battlegoo.battlegoose.views.HeroSelectionView
import se.battlegoo.battlegoose.views.HeroSelectionViewModel
import se.battlegoo.battlegoose.views.screens.HeroSelectionView
import se.battlegoo.battlegoose.views.screens.HeroSelectionViewModel
class HeroSelectionState(
private val createLobbyState: (Hero) -> LobbyState
......
package se.battlegoo.battlegoose.gamestates
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.controllers.JoinLobbyController
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.views.JoinLobbyView
class JoinLobbyState(selectedHero: Hero) : LobbyState(selectedHero) {
private var joinLobbyController: JoinLobbyController = JoinLobbyController(
selectedHero,
joinLobbyView = JoinLobbyView(stage),
onReadyStartBattle = {
GameStateManager.replace(
BattleState(
it.battle.otherPlayerID,
it.battle.battleID,
it.battle.hostHero.toHero(),
it.battle.otherHero!!.toHero(),
false
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage
)
override fun update(dt: Float) {
joinLobbyController.update(dt)
}
override fun render(sb: SpriteBatch) {
joinLobbyController.render(sb)
}
override fun dispose() {
joinLobbyController.dispose()
}
}
......@@ -3,7 +3,7 @@ package se.battlegoo.battlegoose.gamestates
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.network.LeaderboardEntry
import se.battlegoo.battlegoose.network.MultiplayerService
import se.battlegoo.battlegoose.views.LeaderboardView
import se.battlegoo.battlegoose.views.screens.LeaderboardView
class LeaderboardState : GameState() {
......
package se.battlegoo.battlegoose.gamestates
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.controllers.CreateLobbyController
import se.battlegoo.battlegoose.controllers.JoinLobbyController
import se.battlegoo.battlegoose.controllers.QuickJoinController
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.views.CreateLobbyView
import se.battlegoo.battlegoose.views.screens.JoinLobbyView
import se.battlegoo.battlegoose.views.screens.QuickJoinView
abstract class LobbyState(val selectedHero: Hero) : GameState()
class CreateLobbyState(selectedHero: Hero) : LobbyState(selectedHero) {
private val createLobbyController: CreateLobbyController = CreateLobbyController(
selectedHero,
createLobbyView = CreateLobbyView(
this::goBack,
stage
),
onClickStartBattle = {
GameStateManager.replace(
BattleState(
it.hostID,
it.battleID,
it.hostHero.toHero(),
it.otherHero!!.toHero(),
true
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage = stage
)
fun goBack() =
createLobbyController.goBack()
override fun update(dt: Float) {
createLobbyController.update(dt)
}
override fun render(sb: SpriteBatch) {
createLobbyController.render(sb)
}
override fun dispose() {
createLobbyController.dispose()
}
}
class JoinLobbyState(selectedHero: Hero) : LobbyState(selectedHero) {
private var joinLobbyController: JoinLobbyController = JoinLobbyController(
selectedHero,
joinLobbyView = JoinLobbyView(stage),
onReadyStartBattle = {
GameStateManager.replace(
BattleState(
it.battle.otherPlayerID,
it.battle.battleID,
it.battle.hostHero.toHero(),
it.battle.otherHero!!.toHero(),
false
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage
)
override fun update(dt: Float) {
joinLobbyController.update(dt)
}
override fun render(sb: SpriteBatch) {
joinLobbyController.render(sb)
}
override fun dispose() {
joinLobbyController.dispose()
}
}
class QuickJoinState(selectedHero: Hero) : LobbyState(selectedHero) {
private val quickJoinController = QuickJoinController(
selectedHero,
quickJoinView = QuickJoinView(this::goBack, stage),
onReadyStartBattle = { battle, isHost ->
GameStateManager.replace(
BattleState(
if (isHost) battle.hostID else battle.otherPlayerID,
battle.battleID,
battle.hostHero.toHero(),
battle.otherHero!!.toHero(),
isHost
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage = stage
)
private fun goBack(): Unit = quickJoinController.goBack()
override fun update(dt: Float) {
quickJoinController.update(dt)
}
override fun render(sb: SpriteBatch) {
quickJoinController.render(sb)
}
override fun dispose() {
quickJoinController.dispose()
}
}
......@@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.controllers.ChangeUsernameController
import se.battlegoo.battlegoose.views.ChangeUsernameView
import se.battlegoo.battlegoose.views.MainMenuView
import se.battlegoo.battlegoose.views.screens.MainMenuView
class MainMenuState :
GameState() {
......
package se.battlegoo.battlegoose.gamestates
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import se.battlegoo.battlegoose.controllers.QuickJoinController
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.views.QuickJoinView
class QuickJoinState(selectedHero: Hero) : LobbyState(selectedHero) {
private val quickJoinController = QuickJoinController(
selectedHero,
quickJoinView = QuickJoinView(this::goBack, stage),
onReadyStartBattle = { battle, isHost ->
GameStateManager.replace(
BattleState(
if (isHost) battle.hostID else battle.otherPlayerID,
battle.battleID,
battle.hostHero.toHero(),
battle.otherHero!!.toHero(),
isHost
)
)
},
onClickMainMenu = { GameStateManager.goBack() },
stage = stage
)
private fun goBack(): Unit = quickJoinController.goBack()
override fun update(dt: Float) {
quickJoinController.update(dt)
}
override fun render(sb: SpriteBatch) {
quickJoinController.render(sb)
}
override fun dispose() {
quickJoinController.dispose()
}
}
......@@ -5,7 +5,7 @@ import se.battlegoo.battlegoose.controllers.TutorialController
import se.battlegoo.battlegoose.models.tutorial.Tutorial
import se.battlegoo.battlegoose.models.tutorial.TutorialSprite
import se.battlegoo.battlegoose.models.tutorial.TutorialStep
import se.battlegoo.battlegoose.views.TutorialView
import se.battlegoo.battlegoose.views.screens.TutorialView
class TutorialState : GameState() {
......
......@@ -10,7 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.gamestates.GameStateManager
import se.battlegoo.battlegoose.views.Skins
import se.battlegoo.battlegoose.views.utils.Skins
import java.util.UUID
import kotlin.math.roundToInt
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment