diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index db68ee4..e7c62e1 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -12,7 +12,7 @@ import GameplayKit class Base : GKEntity{ var unitCount:Int - init(team: Team?, position: CGPoint ) { + init(position: CGPoint, team: Team! = nil) { self.unitCount = 0 super.init() addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position)) diff --git a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift index 887f78a..d7d388c 100644 --- a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift +++ b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift @@ -27,8 +27,8 @@ class TwoPlayerDefaultTestMap: MapProtocoll { func create() { // Player one (leftest base) let basePlayerOne = Base( - team: .team1 , - position: CGPoint(x: self.size.width * 0.1, y: self.size.height / 2) + position: CGPoint(x: self.size.width * 0.1, y: self.size.height / 2), + team: .team1 ) entityManager.add(basePlayerOne) @@ -49,13 +49,13 @@ class TwoPlayerDefaultTestMap: MapProtocoll { genericBasePositions.append(CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.75)) for pos in genericBasePositions { - entityManager.add(Base(team: nil, position: pos)) + entityManager.add(Base(position: pos)) } // Player two (rightest base) let basePlayerTwo = Base( - team: .team2 , - position: CGPoint(x: self.size.width * 0.9, y: self.size.height / 2) + position: CGPoint(x: self.size.width * 0.9, y: self.size.height / 2), + team: .team2 ) entityManager.add(basePlayerTwo) }