Added missing line

This commit is contained in:
Aldin Duraki 2020-05-15 17:21:06 +02:00
parent d949f57a87
commit 84effcf6bf

View File

@ -23,6 +23,7 @@ class Base: GKEntity{
self.adjacencyList = [Base]() self.adjacencyList = [Base]()
self.changeOwnership = false self.changeOwnership = false
self.ownershipPlayer = player self.ownershipPlayer = player
self.baseID = Base.BASE_ID_COUNT
Base.BASE_ID_COUNT += 1 Base.BASE_ID_COUNT += 1
super.init() super.init()
@ -41,13 +42,7 @@ class Base: GKEntity{
DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, unitCount: units)) DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, unitCount: units))
return [self, base] return [self, base]
} }
func attackBase(base: Base, units: Int) -> [GKEntity]{
base.changeOwnerShip = true
self.unitCount -= units
base.unitCount += units
DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, unitCount: units))
return [self, base]
}
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")