diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 02011c4..97b6f1b 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -23,6 +23,7 @@ class Base: GKEntity{ self.adjacencyList = [Base]() self.changeOwnership = false self.ownershipPlayer = player + self.baseID = Base.BASE_ID_COUNT Base.BASE_ID_COUNT += 1 super.init() @@ -41,13 +42,7 @@ class Base: GKEntity{ DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, unitCount: units)) 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) { fatalError("init(coder:) has not been implemented")