Remove TestMap

This commit is contained in:
Marcel Schwarz 2020-05-29 16:09:42 +02:00
parent 02c7903705
commit b210e04d38
3 changed files with 1 additions and 89 deletions

View File

@ -44,7 +44,6 @@
9EEDE02D246FCD770096C735 /* SpinningLogoEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */; }; 9EEDE02D246FCD770096C735 /* SpinningLogoEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */; };
9EEDE02F246FCD800096C735 /* SpinningLogoComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */; }; 9EEDE02F246FCD800096C735 /* SpinningLogoComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */; };
AB0B88F6247AD89200C8DF66 /* SkillComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB0B88F5247AD89200C8DF66 /* SkillComponent.swift */; }; AB0B88F6247AD89200C8DF66 /* SkillComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB0B88F5247AD89200C8DF66 /* SkillComponent.swift */; };
AB1D759D245DD18100671525 /* TwoPlayerDefaultTestMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1D759B245DD18100671525 /* TwoPlayerDefaultTestMap.swift */; };
AB1D75A0245DEC0500671525 /* MapFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1D759F245DEC0500671525 /* MapFactory.swift */; }; AB1D75A0245DEC0500671525 /* MapFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1D759F245DEC0500671525 /* MapFactory.swift */; };
AB21D7D5246C748A00B09CBA /* TwoPlayerMapGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */; }; AB21D7D5246C748A00B09CBA /* TwoPlayerMapGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */; };
ABA03DA0244BD54F00A66916 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA03D9F244BD54F00A66916 /* Base.swift */; }; ABA03DA0244BD54F00A66916 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA03D9F244BD54F00A66916 /* Base.swift */; };
@ -111,7 +110,6 @@
9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoEntity.swift; sourceTree = "<group>"; }; 9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoEntity.swift; sourceTree = "<group>"; };
9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoComponent.swift; sourceTree = "<group>"; }; 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoComponent.swift; sourceTree = "<group>"; };
AB0B88F5247AD89200C8DF66 /* SkillComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkillComponent.swift; sourceTree = "<group>"; }; AB0B88F5247AD89200C8DF66 /* SkillComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkillComponent.swift; sourceTree = "<group>"; };
AB1D759B245DD18100671525 /* TwoPlayerDefaultTestMap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TwoPlayerDefaultTestMap.swift; sourceTree = "<group>"; };
AB1D759F245DEC0500671525 /* MapFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapFactory.swift; sourceTree = "<group>"; }; AB1D759F245DEC0500671525 /* MapFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapFactory.swift; sourceTree = "<group>"; };
AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoPlayerMapGenerator.swift; sourceTree = "<group>"; }; AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoPlayerMapGenerator.swift; sourceTree = "<group>"; };
ABA03D9F244BD54F00A66916 /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = "<group>"; }; ABA03D9F244BD54F00A66916 /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = "<group>"; };
@ -286,7 +284,6 @@
children = ( children = (
3E67853F24728368007B9DE4 /* CElements.swift */, 3E67853F24728368007B9DE4 /* CElements.swift */,
AB1D759F245DEC0500671525 /* MapFactory.swift */, AB1D759F245DEC0500671525 /* MapFactory.swift */,
AB1D759B245DD18100671525 /* TwoPlayerDefaultTestMap.swift */,
AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */, AB21D7D4246C748A00B09CBA /* TwoPlayerMapGenerator.swift */,
); );
path = Map; path = Map;
@ -422,7 +419,6 @@
C064E9A8246C0EA50022B228 /* LabelNode.swift in Sources */, C064E9A8246C0EA50022B228 /* LabelNode.swift in Sources */,
3F745DF0246F48FC00CE7375 /* PlayerMoveType.swift in Sources */, 3F745DF0246F48FC00CE7375 /* PlayerMoveType.swift in Sources */,
AB1D75A0245DEC0500671525 /* MapFactory.swift in Sources */, AB1D75A0245DEC0500671525 /* MapFactory.swift in Sources */,
AB1D759D245DD18100671525 /* TwoPlayerDefaultTestMap.swift in Sources */,
3E67854024728368007B9DE4 /* CElements.swift in Sources */, 3E67854024728368007B9DE4 /* CElements.swift in Sources */,
ABA03DA0244BD54F00A66916 /* Base.swift in Sources */, ABA03DA0244BD54F00A66916 /* Base.swift in Sources */,
C064E9AC246C151F0022B228 /* Label.swift in Sources */, C064E9AC246C151F0022B228 /* Label.swift in Sources */,

View File

@ -44,7 +44,7 @@ class MapFactory {
self.twoPlayerMapGenerator = TwoPlayerMapGenerator(scene: scene, entityManager: entityManager) self.twoPlayerMapGenerator = TwoPlayerMapGenerator(scene: scene, entityManager: entityManager)
} }
func loadMap() -> MapGenerationModel{ func loadMap() -> MapGenerationModel {
let mapModel = TwoPlayerMapGenerator.getNewMapModel() let mapModel = TwoPlayerMapGenerator.getNewMapModel()
loadMap(fromModel: mapModel) loadMap(fromModel: mapModel)
return mapModel return mapModel

View File

@ -1,84 +0,0 @@
//
// DefaultTestMap.swift
// GoldWars
//
// Created by Marcel Schwarz on 02.05.20.
// Copyright © 2020 SP2. All rights reserved.
//
import Foundation
import SpriteKit
import GameKit
class TwoPlayerDefaultTestMap: MapProtocol {
var entityManager: EntityManager!
var size: CGSize!
required init(scene: SKScene, entityManager: EntityManager) {
self.entityManager = entityManager;
self.size = scene.size
}
func load(withModel mapModel: MapGenerationModel) {
// Create Bases
let basePlayerOne = Base(
position: CGPoint(x: self.size.width * 0.1, y: self.size.height / 2),
player: (GameCenterManager.sharedInstance.isServer) ? GKLocalPlayer.local : GameCenterManager.sharedInstance.myMatch?.players[0],
team: .team1
)
let column1 = [
Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.25)),
Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.5)),
Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.75))
]
let column2 = [
Base(position: CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.333)),
Base(position: CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.666))
]
let column3 = [
Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.25)),
Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.5)),
Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.75))
]
let basePlayerTwo = Base(
position: CGPoint(x: self.size.width * 0.9, y: self.size.height / 2),
player: (!GameCenterManager.sharedInstance.isServer) ? GKLocalPlayer.local : GameCenterManager.sharedInstance.myMatch?.players[0],
team: .team2
)
// Create adjacency Mapping
basePlayerOne.adjacencyList.append(contentsOf: column1)
column1.forEach({currBase in
currBase.adjacencyList.append(contentsOf: column2)
currBase.adjacencyList.append(basePlayerOne)
})
column2.forEach({currBase in
currBase.adjacencyList.append(contentsOf: column3)
currBase.adjacencyList.append(contentsOf: column1)
})
column3.forEach({currBase in
currBase.adjacencyList.append(basePlayerTwo)
currBase.adjacencyList.append(contentsOf: column3)
})
basePlayerTwo.adjacencyList.append(contentsOf: column3)
// Register bases with the EntityManager
entityManager.add(basePlayerOne)
column1.forEach({base in entityManager.add(base)})
column2.forEach({base in entityManager.add(base)})
column3.forEach({base in entityManager.add(base)})
entityManager.add(basePlayerTwo)
}
}