From 323ca45e512ca39e3f02c3a7e706bcb85a4d1a35 Mon Sep 17 00:00:00 2001 From: Niko Jochim Date: Fri, 1 May 2020 22:02:26 +0200 Subject: [PATCH] fix teamComponents reference --- GoldWars/GoldWars.xcodeproj/project.pbxproj | 8 ++--- .../GoldWars/Components/TeamComponent.swift | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 GoldWars/GoldWars/Components/TeamComponent.swift diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index ce36fc9..22753a8 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -20,8 +20,8 @@ 11036113244B3E30008610AF /* MenuScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11036112244B3E30008610AF /* MenuScene.swift */; }; 116060F7245C57D2004E5A36 /* EntityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 116060F6245C57D2004E5A36 /* EntityManager.swift */; }; 11738A3B24508F68004426F1 /* Unit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11738A3A24508F68004426F1 /* Unit.swift */; }; - 9E286A88245C6C6800EB32B8 /* TeamComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E286A87245C6C6800EB32B8 /* TeamComponent.swift */; }; 9E78ACB6245C9A5300526FF7 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E78ACB5245C9A5300526FF7 /* GameKit.framework */; }; + 9E78ACB8245CB75B00526FF7 /* TeamComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */; }; 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */; }; 9EA3ABEB245C6DFA006BC61D /* BaseNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */; }; 9EA3ABED245C8143006BC61D /* ModalBackgroundComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA3ABEC245C8143006BC61D /* ModalBackgroundComponent.swift */; }; @@ -68,8 +68,8 @@ 11036112244B3E30008610AF /* MenuScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuScene.swift; sourceTree = ""; }; 116060F6245C57D2004E5A36 /* EntityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntityManager.swift; sourceTree = ""; }; 11738A3A24508F68004426F1 /* Unit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unit.swift; sourceTree = ""; }; - 9E286A87245C6C6800EB32B8 /* TeamComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TeamComponent.swift; path = ../../../../MonsterWars/MonsterWars/Components/TeamComponent.swift; sourceTree = ""; }; 9E78ACB5245C9A5300526FF7 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; + 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamComponent.swift; sourceTree = ""; }; 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultBaseComponent.swift; sourceTree = ""; }; 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNode.swift; sourceTree = ""; }; 9EA3ABEC245C8143006BC61D /* ModalBackgroundComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalBackgroundComponent.swift; sourceTree = ""; }; @@ -165,11 +165,11 @@ 116060F4245C56EA004E5A36 /* Components */ = { isa = PBXGroup; children = ( - 9E286A87245C6C6800EB32B8 /* TeamComponent.swift */, 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */, 9EA3ABEC245C8143006BC61D /* ModalBackgroundComponent.swift */, 9EA3ABEE245C834B006BC61D /* ModalContentComponent.swift */, 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */, + 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */, ); path = Components; sourceTree = ""; @@ -354,6 +354,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9E78ACB8245CB75B00526FF7 /* TeamComponent.swift in Sources */, 9EA3ABEF245C834B006BC61D /* ModalContentComponent.swift in Sources */, 9EC86BA6245C8AD000796EF3 /* ModalType.swift in Sources */, 9EA3ABEB245C6DFA006BC61D /* BaseNode.swift in Sources */, @@ -364,7 +365,6 @@ 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */, 9EA3ABED245C8143006BC61D /* ModalBackgroundComponent.swift in Sources */, ABA03DA0244BD54F00A66916 /* Base.swift in Sources */, - 9E286A88245C6C6800EB32B8 /* TeamComponent.swift in Sources */, 110360DB244B101A008610AF /* GameViewController.swift in Sources */, 110360D3244B101A008610AF /* AppDelegate.swift in Sources */, 9EC86B9F245C88A300796EF3 /* Modal.swift in Sources */, diff --git a/GoldWars/GoldWars/Components/TeamComponent.swift b/GoldWars/GoldWars/Components/TeamComponent.swift new file mode 100644 index 0000000..4413436 --- /dev/null +++ b/GoldWars/GoldWars/Components/TeamComponent.swift @@ -0,0 +1,34 @@ +// +// TeamComponent.swift +// GoldWars +// +// Created by Niko Jochim on 01.05.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import SpriteKit +import GameplayKit + +enum Team: Int { + case team1 = 1 + case team2 = 2 + case team3 = 3 + case team4 = 4 + + static let allValues = [team1, team2,team3,team4] + +} + +class TeamComponent: GKComponent { + let team: Team + + init(team: Team) { + self.team = team + super.init() + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} +