Skip to content

Commit

Permalink
Previously applied orders added to state
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulfheart authored and zond committed Dec 15, 2020
1 parent 293d573 commit ceee84c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (self *movement) execute(s *State) (err error) {

type State struct {
orders map[godip.Province]godip.Adjudicator
previouslyAppliedOrders map[godip.Province]godip.Adjudicator
units map[godip.Province]godip.Unit
dislodgeds map[godip.Province]godip.Unit
supplyCenters map[godip.Province]godip.Nation
Expand Down Expand Up @@ -202,7 +203,7 @@ func (self *State) Next() (err error) {
}

/*
Add hold to units missing orders.
Add default orders to units missing orders.
*/
for prov, _ := range self.units {
if _, ok := self.orders[prov]; !ok {
Expand All @@ -214,6 +215,8 @@ func (self *State) Next() (err error) {
}
}

self.previouslyAppliedOrders = self.orders

/*
Adjudicate orders.
*/
Expand Down Expand Up @@ -257,6 +260,10 @@ func (self *State) Next() (err error) {
return
}

func (self *State) PreviouslyAppliedOrders() map[godip.Province]godip.Adjudicator{
return self.previouslyAppliedOrders
}

func (self *State) Phase() godip.Phase {
return self.phase
}
Expand Down

0 comments on commit ceee84c

Please sign in to comment.