diff --git a/GoldWars/GoldWars/Entities/EntityManager.swift b/GoldWars/GoldWars/Entities/EntityManager.swift index 07f3b41..6bf1d5b 100644 --- a/GoldWars/GoldWars/Entities/EntityManager.swift +++ b/GoldWars/GoldWars/Entities/EntityManager.swift @@ -240,7 +240,7 @@ class EntityManager { } func getHUD() -> HUD? { - return entities.filter{$0 is HUD}[0] as! HUD + return entities.filter{$0 is HUD}[0] as? HUD } func getSnapshotModel() -> SnapshotModel { diff --git a/GoldWars/GoldWars/Map/CElements.swift b/GoldWars/GoldWars/Map/CElements.swift index 22fc4dc..1e158be 100644 --- a/GoldWars/GoldWars/Map/CElements.swift +++ b/GoldWars/GoldWars/Map/CElements.swift @@ -529,16 +529,12 @@ class CElement7: CenterElementProtocol { } func connectInnerBases() { - self.leftBase.adjacencyList.append(self.rightBase) self.leftBase.adjacencyList.append(self.topBase) self.leftBase.adjacencyList.append(self.bottomBase) - self.rightBase.adjacencyList.append(self.leftBase) self.rightBase.adjacencyList.append(self.topBase) self.rightBase.adjacencyList.append(self.bottomBase) self.topBase.adjacencyList.append(self.leftBase) self.topBase.adjacencyList.append(self.rightBase) - self.topBase.adjacencyList.append(self.bottomBase) - self.bottomBase.adjacencyList.append(self.topBase) self.bottomBase.adjacencyList.append(self.rightBase) self.bottomBase.adjacencyList.append(self.leftBase) } @@ -1116,16 +1112,12 @@ class CElement15: CenterElementProtocol { } func connectInnerBases() { - self.leftBase.adjacencyList.append(self.rightBase) self.leftBase.adjacencyList.append(self.topBase) self.leftBase.adjacencyList.append(self.bottomBase) - self.rightBase.adjacencyList.append(self.leftBase) self.rightBase.adjacencyList.append(self.topBase) self.rightBase.adjacencyList.append(self.bottomBase) self.topBase.adjacencyList.append(self.leftBase) self.topBase.adjacencyList.append(self.rightBase) - self.topBase.adjacencyList.append(self.bottomBase) - self.bottomBase.adjacencyList.append(self.topBase) self.bottomBase.adjacencyList.append(self.rightBase) self.bottomBase.adjacencyList.append(self.leftBase) } @@ -1209,16 +1201,12 @@ class CElement16: CenterElementProtocol { } func connectInnerBases() { - self.leftBase.adjacencyList.append(self.rightBase) self.leftBase.adjacencyList.append(self.topBase) self.leftBase.adjacencyList.append(self.bottomBase) - self.rightBase.adjacencyList.append(self.leftBase) self.rightBase.adjacencyList.append(self.topBase) self.rightBase.adjacencyList.append(self.bottomBase) self.topBase.adjacencyList.append(self.leftBase) self.topBase.adjacencyList.append(self.rightBase) - self.topBase.adjacencyList.append(self.bottomBase) - self.bottomBase.adjacencyList.append(self.topBase) self.bottomBase.adjacencyList.append(self.rightBase) self.bottomBase.adjacencyList.append(self.leftBase) } @@ -1302,16 +1290,12 @@ class CElement17: CenterElementProtocol { } func connectInnerBases() { - self.leftBase.adjacencyList.append(self.rightBase) self.leftBase.adjacencyList.append(self.topBase) self.leftBase.adjacencyList.append(self.bottomBase) - self.rightBase.adjacencyList.append(self.leftBase) self.rightBase.adjacencyList.append(self.topBase) self.rightBase.adjacencyList.append(self.bottomBase) self.topBase.adjacencyList.append(self.leftBase) self.topBase.adjacencyList.append(self.rightBase) - self.topBase.adjacencyList.append(self.bottomBase) - self.bottomBase.adjacencyList.append(self.topBase) self.bottomBase.adjacencyList.append(self.rightBase) self.bottomBase.adjacencyList.append(self.leftBase) }