diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 70fe75d..6851cf3 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -8,17 +8,20 @@ import SpriteKit import GameplayKit +import GameKit class Base: GKEntity { var unitCount: Int var adjacencyList: Array var changeOwnerShip: Bool - - init(position: CGPoint, team: Team! = nil) { + var ownerShipPlayer: GKPlayer? + + init(position: CGPoint, player: GKPlayer! = nil, team: Team! = nil) { self.unitCount = 0 self.adjacencyList = [Base]() - self.changeOwnerShip = false + self.changeOwnerShip = false + self.ownerShipPlayer = player super.init() addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position))