diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-17 12:43:22 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:50:11 +0200 |
| commit | 57e00949e66cf17cc70d2556160647b3cce3ffdf (patch) | |
| tree | b179816d173aa78c97a4443a87aeae272f0cfe63 /go/game/state.go | |
| parent | 28defc1cad1a96a2954780efa01396db8bb2fe31 (diff) | |
| download | muhqs-game-57e00949e66cf17cc70d2556160647b3cce3ffdf.tar.gz muhqs-game-57e00949e66cf17cc70d2556160647b3cce3ffdf.zip | |
export less methods
Diffstat (limited to 'go/game/state.go')
| -rw-r--r-- | go/game/state.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/go/game/state.go b/go/game/state.go index 4af56b10..d98595b4 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -74,19 +74,19 @@ func (s *State) Loop() []*Player { p.Draw() s.ActivePhase = Phases.UpkeepPhase - p.Upkeep() - s.PhaseChange() + p.upkeep() + s.phaseChange() s.ActivePhase = Phases.ActionPhase - p.ActionPhase() - s.PhaseChange() + p.actionPhase() + s.phaseChange() s.ActivePhase = Phases.BuyPhase - p.BuyPhase() - s.PhaseChange() + p.buyPhase() + s.phaseChange() s.ActivePhase = Phases.DiscardPhase - p.DiscardPhase() + p.discardPhase() winners = s.Map.WinCondition(s) } @@ -100,7 +100,7 @@ func (s *State) stateBasedActions() { p.Card().Impl.stateBasedActions(s, p) if p.IsDestroyed() { - s.DestroyPermanent(p) + s.destroyPermanent(p) } } } @@ -254,7 +254,7 @@ func (s *State) DeclareAction(a Action) { s.broadcastNotification(newDeclaredActionNotification(a, err)) } -func (s *State) AllPassing(skipFirst bool) bool { +func (s *State) allPassing(skipFirst bool) bool { nPlayers := len(s.Players) i := 0 if skipFirst { @@ -275,10 +275,10 @@ func (s *State) AllPassing(skipFirst bool) bool { return true } -func (s *State) PhaseChange() { +func (s *State) phaseChange() { skipFirst := true - for !s.AllPassing(skipFirst) { - s.Stack.Resolve() + for !s.allPassing(skipFirst) { + s.Stack.resolve() skipFirst = false } } @@ -342,7 +342,7 @@ func removePtr[P *Unit](collection []P, ptr P) []P { return collection } -func (s *State) DestroyPermanent(p Permanent) { +func (s *State) destroyPermanent(p Permanent) { leaveTile(p) s.removePermanent(p) @@ -353,9 +353,9 @@ func (s *State) DestroyPermanent(p Permanent) { p.Owner().DiscardPile.AddCard(p.Card()) } -func (s *State) Fight(p1, p2 Permanent) { - p1.Fight(p2) - p2.Fight(p1) +func (s *State) fight(p1, p2 Permanent) { + p1.fight(p2) + p2.fight(p1) } func (s *State) MoveUnit(u *Unit, t *Tile) { |
