tome_game/game_view.go

37 lines
909 B
Go
Raw Normal View History

2021-10-01 13:40:46 -04:00
package tome_game
import (
. "git.saintnet.tech/tomecraft/tome_lib"
)
func NewView(id int, g *Game) *GameView {
if id == SentinalID {
return &GameView{
Board: g.GameBoard,
Player: g.SentinalPlayer,
DeckSize: g.SentinalDeck.Size(),
EnemyLife: g.ScourgePlayer.Life,
EnemyDeckSize: g.ScourgeDeck.Size(),
EnemyHandSize: len(g.ScourgePlayer.Hand),
CurrentTurn: g.CurrentTurn,
CanDraw: g.CanDraw,
HasDrawn: g.HasDrawn,
Status: g.Status,
}
} else {
return &GameView{
Board: g.GameBoard,
Player: g.ScourgePlayer,
DeckSize: g.ScourgeDeck.Size(),
EnemyLife: g.SentinalPlayer.Life,
EnemyDeckSize: g.SentinalDeck.Size(),
EnemyHandSize: len(g.SentinalPlayer.Hand),
CurrentTurn: g.CurrentTurn,
CanDraw: g.CanDraw,
HasDrawn: g.HasDrawn,
Status: g.Status,
}
}
}