From 84effcf6bf660a3a47fc19690afa7e47751934eb Mon Sep 17 00:00:00 2001 From: Aldin Duraki Date: Fri, 15 May 2020 17:21:06 +0200 Subject: [PATCH] Added missing line --- GoldWars/GoldWars/Entities/Base.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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")