From 7fc4a5145f915ba5db179e2dc31d51fc7d173e0f Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 2 May 2020 21:51:31 +0200 Subject: [PATCH] Do some polishing --- GoldWars/GoldWars/Entities/Base.swift | 2 +- GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift | 2 +- GoldWars/GoldWars/Scenes/GameScene.swift | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 0455210..6ae0a10 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -15,7 +15,7 @@ class Base : GKEntity { init(position: CGPoint, team: Team! = nil) { self.unitCount = 0 - self.adjacencyList = Array() + self.adjacencyList = [Base]() super.init() diff --git a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift index a390f83..beff433 100644 --- a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift +++ b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift @@ -69,7 +69,7 @@ class TwoPlayerDefaultTestMap: MapProtocol { basePlayerTwo.adjacencyList.append(contentsOf: column3) - // Add Bases to GameScene + // Register bases with the EntityManager entityManager.add(basePlayerOne) column1.forEach({base in entityManager.add(base)}) diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index 7e03378..678b327 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -33,7 +33,6 @@ class GameScene: SKScene{ } } - // TODO: Issue #24 create Map generation Service func initMap() { MapFactory(scene: self, entityManager: self.entityManager).loadMap(playerCount: 2) }