add nullable ownerShipPlayer to Base and add init of it to init-method
This commit is contained in:
parent
6e7758767f
commit
e1b0ac4d87
@ -8,17 +8,20 @@
|
|||||||
|
|
||||||
import SpriteKit
|
import SpriteKit
|
||||||
import GameplayKit
|
import GameplayKit
|
||||||
|
import GameKit
|
||||||
|
|
||||||
class Base: GKEntity {
|
class Base: GKEntity {
|
||||||
|
|
||||||
var unitCount: Int
|
var unitCount: Int
|
||||||
var adjacencyList: Array<Base>
|
var adjacencyList: Array<Base>
|
||||||
var changeOwnerShip: Bool
|
var changeOwnerShip: Bool
|
||||||
|
var ownerShipPlayer: GKPlayer?
|
||||||
init(position: CGPoint, team: Team! = nil) {
|
|
||||||
|
init(position: CGPoint, player: GKPlayer! = nil, team: Team! = nil) {
|
||||||
self.unitCount = 0
|
self.unitCount = 0
|
||||||
self.adjacencyList = [Base]()
|
self.adjacencyList = [Base]()
|
||||||
self.changeOwnerShip = false
|
self.changeOwnerShip = false
|
||||||
|
self.ownerShipPlayer = player
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position))
|
addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position))
|
||||||
|
Loading…
Reference in New Issue
Block a user