diff --git a/ArkGames.xcodeproj/project.pbxproj b/ArkGames.xcodeproj/project.pbxproj index 61dc6d0..1869c35 100644 --- a/ArkGames.xcodeproj/project.pbxproj +++ b/ArkGames.xcodeproj/project.pbxproj @@ -101,6 +101,8 @@ 28E65B142BCEDF7F00AF69B4 /* snake_green_head.png in Resources */ = {isa = PBXBuildFile; fileRef = 28E65B112BCEDF7F00AF69B4 /* snake_green_head.png */; }; 28E65B162BCEDF9700AF69B4 /* apple_alt.png in Resources */ = {isa = PBXBuildFile; fileRef = 28E65B152BCEDF9700AF69B4 /* apple_alt.png */; }; 28EFCB1D2BCC3C4E0059A908 /* ArkDemoMultiplayerPopover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28EFCB1C2BCC3C4E0059A908 /* ArkDemoMultiplayerPopover.swift */; }; + 28FAA3E42C2DE63D00D2B9F3 /* ArkKit in Frameworks */ = {isa = PBXBuildFile; productRef = 28FAA3E32C2DE63D00D2B9F3 /* ArkKit */; }; + 28FAA3E62C2DE64000D2B9F3 /* DequeModule in Frameworks */ = {isa = PBXBuildFile; productRef = 28FAA3E52C2DE64000D2B9F3 /* DequeModule */; }; 8F3813052BCE755A0058E107 /* Ground_Tile_01_A.png in Resources */ = {isa = PBXBuildFile; fileRef = 8F3812FF2BCE755A0058E107 /* Ground_Tile_01_A.png */; }; 8F3813062BCE755A0058E107 /* Ground_Tile_01_B.png in Resources */ = {isa = PBXBuildFile; fileRef = 8F3813002BCE755A0058E107 /* Ground_Tile_01_B.png */; }; 8F3813072BCE755A0058E107 /* Ground_Tile_02_C.png in Resources */ = {isa = PBXBuildFile; fileRef = 8F3813012BCE755A0058E107 /* Ground_Tile_02_C.png */; }; @@ -230,7 +232,6 @@ 2812FCC22BC4395D00A0FE24 /* TankRaceGameCollisionStrategyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankRaceGameCollisionStrategyManager.swift; sourceTree = ""; }; 2812FCC42BC4424200A0FE24 /* TankRaceGameEntityCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankRaceGameEntityCreator.swift; sourceTree = ""; }; 2812FCC62BC442BD00A0FE24 /* TankRaceGameTerrainObjectBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankRaceGameTerrainObjectBuilder.swift; sourceTree = ""; }; - 285ABB222C2DE20800CF4C05 /* ArkGames.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = ArkGames.app; path = "/Users/markus/Downloads/ArkKit/build/Debug-iphoneos/ArkGames.app"; sourceTree = ""; }; 286C09BF2BADD0BB000343B1 /* TankGameMapBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankGameMapBuilder.swift; sourceTree = ""; }; 286C09C12BADD5FB000343B1 /* TankGameTerrainObjectBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankGameTerrainObjectBuilder.swift; sourceTree = ""; }; 286F6E2D2BCFAAC900B857C5 /* TankHealthPackGeneratorComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TankHealthPackGeneratorComponent.swift; sourceTree = ""; }; @@ -262,6 +263,7 @@ 28E65B112BCEDF7F00AF69B4 /* snake_green_head.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = snake_green_head.png; sourceTree = ""; }; 28E65B152BCEDF9700AF69B4 /* apple_alt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = apple_alt.png; sourceTree = ""; }; 28EFCB1C2BCC3C4E0059A908 /* ArkDemoMultiplayerPopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArkDemoMultiplayerPopover.swift; sourceTree = ""; }; + 28FAA3E12C2DE5A200D2B9F3 /* ArkGames.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArkGames.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8F3812FF2BCE755A0058E107 /* Ground_Tile_01_A.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ground_Tile_01_A.png; sourceTree = ""; }; 8F3813002BCE755A0058E107 /* Ground_Tile_01_B.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ground_Tile_01_B.png; sourceTree = ""; }; 8F3813012BCE755A0058E107 /* Ground_Tile_02_C.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ground_Tile_02_C.png; sourceTree = ""; }; @@ -333,6 +335,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 28FAA3E42C2DE63D00D2B9F3 /* ArkKit in Frameworks */, + 28FAA3E62C2DE64000D2B9F3 /* DequeModule in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -567,6 +571,13 @@ path = Events; sourceTree = ""; }; + 28FAA3E22C2DE63D00D2B9F3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; 941A45AC2BCD4D9000689D15 /* FlappyBird */ = { isa = PBXGroup; children = ( @@ -812,6 +823,8 @@ 02D8E91D2BAC419400BF3A07 /* assets */, 02C395312BA9ED230075F1CA /* README.md */, 02C395102BA6EBBA0075F1CA /* ArkGameExample */, + 28FAA3E12C2DE5A200D2B9F3 /* ArkGames.app */, + 28FAA3E22C2DE63D00D2B9F3 /* Frameworks */, ); sourceTree = ""; }; @@ -833,9 +846,11 @@ ); name = ArkGames; packageProductDependencies = ( + 28FAA3E32C2DE63D00D2B9F3 /* ArkKit */, + 28FAA3E52C2DE64000D2B9F3 /* DequeModule */, ); productName = LevelKit; - productReference = 285ABB222C2DE20800CF4C05 /* ArkGames.app */; + productReference = 28FAA3E12C2DE5A200D2B9F3 /* ArkGames.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -1218,7 +1233,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 879B4J7JQ8; + DEVELOPMENT_TEAM = ""; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ArkGameExample/Info.plist; @@ -1233,7 +1248,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ArkKit.markus; + PRODUCT_BUNDLE_IDENTIFIER = ArkKit.arkkit; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -1252,7 +1267,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 879B4J7JQ8; + DEVELOPMENT_TEAM = ""; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ArkGameExample/Info.plist; @@ -1267,7 +1282,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ArkKit.markus; + PRODUCT_BUNDLE_IDENTIFIER = ArkKit.arkkit; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -1319,6 +1334,19 @@ }; }; /* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 28FAA3E32C2DE63D00D2B9F3 /* ArkKit */ = { + isa = XCSwiftPackageProductDependency; + package = 285856B82C2DC2FC008ADE71 /* XCLocalSwiftPackageReference "ArkKit" */; + productName = ArkKit; + }; + 28FAA3E52C2DE64000D2B9F3 /* DequeModule */ = { + isa = XCSwiftPackageProductDependency; + package = 945441182BC9497900E90ECE /* XCRemoteSwiftPackageReference "swift-collections" */; + productName = DequeModule; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = AD787A452B9C636F003EBBD0 /* Project object */; } diff --git a/ArkGames.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ArkGames.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 27fe92e..0000000 --- a/ArkGames.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,24 +0,0 @@ -{ - "originHash" : "94e45281d56b27b6b1efd95bcf18f7541273164c47fc43b74c236558896d2357", - "pins" : [ - { - "identity" : "p2psharekit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/dobster/P2PShareKit/", - "state" : { - "revision" : "e383b109e24044ce0735e2251047c662ab68b9b4", - "version" : "0.2.0" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections.git", - "state" : { - "revision" : "ee97538f5b81ae89698fd95938896dec5217b148", - "version" : "1.1.1" - } - } - ], - "version" : 3 -} diff --git a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpIfHostStrategy.swift b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpIfHostStrategy.swift index 4c54961..9102e52 100644 --- a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpIfHostStrategy.swift +++ b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpIfHostStrategy.swift @@ -6,7 +6,7 @@ class ArkSetUpIfHostStrategy: Ark } func setUp() { - let startingSetUpStrategy = ArkSetUpWithoutNetwork(ark: ark) + let startingSetUpStrategy = ArkSetUpWithoutNetworkStrategy(ark: ark) startingSetUpStrategy.setUp() guard let ark = ark, let networkPlayableInfo = ark.blueprint.networkPlayableInfo, diff --git a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpOrchestrator.swift b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpOrchestrator.swift index 9f0d581..8434b45 100644 --- a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpOrchestrator.swift +++ b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpOrchestrator.swift @@ -4,7 +4,7 @@ struct ArkSetUpOrchestrator { func executeSetUp() { guard let networkPlayableInfo = ark?.blueprint.networkPlayableInfo else { // no network playable set - let noNetworkSetUpStrategy = ArkSetUpWithoutNetwork(ark: ark) + let noNetworkSetUpStrategy = ArkSetUpWithoutNetworkStrategy(ark: ark) noNetworkSetUpStrategy.setUp() return } diff --git a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpWithoutNetworkStrategy.swift b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpWithoutNetworkStrategy.swift index e1c82ab..d6ae045 100644 --- a/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpWithoutNetworkStrategy.swift +++ b/ArkKit/Sources/ArkKit/app/utils/set-up/ArkSetUpWithoutNetworkStrategy.swift @@ -1,4 +1,4 @@ -class ArkSetUpWithoutNetwork: ArkSetUpStrategy { +class ArkSetUpWithoutNetworkStrategy: ArkSetUpStrategy { weak var ark: Ark? init(ark: Ark? = nil) { diff --git a/ArkKit/Sources/ArkKit/ark-camera-kit/Camera.swift b/ArkKit/Sources/ArkKit/ark-camera-kit/Camera.swift index 5e600bb..5c02706 100644 --- a/ArkKit/Sources/ArkKit/ark-camera-kit/Camera.swift +++ b/ArkKit/Sources/ArkKit/ark-camera-kit/Camera.swift @@ -30,14 +30,14 @@ public struct Camera: Codable { public let zoom: CameraZoom public init(canvasPosition: CGPoint, - zoom: Double = 1.0) { + zoom: Double = 1.0) { self.canvasPosition = canvasPosition self.zoom = CameraZoom(widthZoom: zoom, heightZoom: zoom) } public init(canvasPosition: CGPoint, - zoomWidth: Double = 1.0, - zoomHeight: Double = 1.0) { + zoomWidth: Double = 1.0, + zoomHeight: Double = 1.0) { self.canvasPosition = canvasPosition self.zoom = CameraZoom(widthZoom: zoomWidth, heightZoom: zoomHeight) diff --git a/ArkKit/Sources/ArkKit/ark-event-kit/ArkEventManager.swift b/ArkKit/Sources/ArkKit/ark-event-kit/ArkEventManager.swift index a62d77d..f683b24 100644 --- a/ArkKit/Sources/ArkKit/ark-event-kit/ArkEventManager.swift +++ b/ArkKit/Sources/ArkKit/ark-event-kit/ArkEventManager.swift @@ -1,11 +1,11 @@ import Foundation -struct DatedEvent { - let event: any ArkEvent - let timestamp: Date - var priority: Int? +public struct DatedEvent { + public let event: any ArkEvent + public let timestamp: Date + public var priority: Int? - init(event: any ArkEvent, timestamp: Date = Date(), priority: Int? = nil) { + public init(event: any ArkEvent, timestamp: Date = Date(), priority: Int? = nil) { self.event = event self.timestamp = timestamp self.priority = priority ?? event.priority diff --git a/ArkKit/Sources/ArkKit/ark-external-resources/ArkExternalResources.swift b/ArkKit/Sources/ArkKit/ark-external-resources/ArkExternalResources.swift index 981dc4a..718724a 100644 --- a/ArkKit/Sources/ArkKit/ark-external-resources/ArkExternalResources.swift +++ b/ArkKit/Sources/ArkKit/ark-external-resources/ArkExternalResources.swift @@ -6,4 +6,8 @@ public protocol ArkExternalResources { public struct NoExternalResources: ArkExternalResources { public var audioEnum: NoAudio + + public init() { + self.audioEnum = .none + } } diff --git a/ArkKit/Sources/ArkKit/ark-game/view/ArkViewFactory.swift b/ArkKit/Sources/ArkKit/ark-game/view/ArkViewFactory.swift index 08532d0..c72d3c4 100644 --- a/ArkKit/Sources/ArkKit/ark-game/view/ArkViewFactory.swift +++ b/ArkKit/Sources/ArkKit/ark-game/view/ArkViewFactory.swift @@ -1,6 +1,4 @@ -#if canImport(UIKit) import UIKit -#endif class ArkViewFactory { static func generateView(_ parentView: any AbstractParentView) -> (any ArkView)? { diff --git a/ArkKit/Sources/ArkKit/ark-game/view/ui-kit/ArkUIKitView.swift b/ArkKit/Sources/ArkKit/ark-game/view/ui-kit/ArkUIKitView.swift index bf420d2..09dfe70 100644 --- a/ArkKit/Sources/ArkKit/ark-game/view/ui-kit/ArkUIKitView.swift +++ b/ArkKit/Sources/ArkKit/ark-game/view/ui-kit/ArkUIKitView.swift @@ -1,6 +1,4 @@ -#if canImport(UIKit) import UIKit -#endif /** * `ArkUIKitView` is the main page that will render the game's canvas. diff --git a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/GameLoopEventData.swift b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/GameLoopEventData.swift index 63f35ce..7ff8cab 100644 --- a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/GameLoopEventData.swift +++ b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/GameLoopEventData.swift @@ -1,3 +1,3 @@ -protocol GameLoopEventData: ArkEventData { +public protocol GameLoopEventData: ArkEventData { var timeInGame: Double { get } } diff --git a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/PauseGameLoopEvent.swift b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/PauseGameLoopEvent.swift index e62fa33..80c1658 100644 --- a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/PauseGameLoopEvent.swift +++ b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/PauseGameLoopEvent.swift @@ -1,8 +1,18 @@ -struct PauseGameLoopEventData: GameLoopEventData { - let timeInGame: Double - var name: String = "PauseGame" +public struct PauseGameLoopEventData: GameLoopEventData { + public let timeInGame: Double + public var name: String = "PauseGame" + + public init(timeInGame: Double) { + self.timeInGame = timeInGame + } } -struct PauseGameLoopEvent: ArkEvent { - var eventData: PauseGameLoopEventData - var priority: Int? + +public struct PauseGameLoopEvent: ArkEvent { + public var eventData: PauseGameLoopEventData + public var priority: Int? + + public init(timeInGame: Double, priority: Int? = nil ) { + self.eventData = PauseGameLoopEventData(timeInGame: timeInGame) + self.priority = priority + } } diff --git a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/ResumeGameLoopEvent.swift b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/ResumeGameLoopEvent.swift index fe1f394..195b2d8 100644 --- a/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/ResumeGameLoopEvent.swift +++ b/ArkKit/Sources/ArkKit/ark-loop-kit/game-loop-events/ResumeGameLoopEvent.swift @@ -1,8 +1,18 @@ -struct ResumeGameLoopEventData: GameLoopEventData { - let timeInGame: Double - var name: String = "ResumeGame" +public struct ResumeGameLoopEventData: GameLoopEventData { + public let timeInGame: Double + public var name: String = "ResumeGame" + + public init(timeInGame: Double) { + self.timeInGame = timeInGame + } } -struct ResumeGameLoopEvent: ArkEvent { - var eventData: ResumeGameLoopEventData - var priority: Int? + +public struct ResumeGameLoopEvent: ArkEvent { + public var eventData: ResumeGameLoopEventData + public var priority: Int? + + public init(timeInGame: Double, priority: Int? = nil) { + self.eventData = ResumeGameLoopEventData(timeInGame: timeInGame) + self.priority = priority + } } diff --git a/ArkKit/Sources/ArkKit/ark-multiplayer-kit/ArkNetworkService.swift b/ArkKit/Sources/ArkKit/ark-multiplayer-kit/ArkNetworkService.swift index 8689377..70ec187 100644 --- a/ArkKit/Sources/ArkKit/ark-multiplayer-kit/ArkNetworkService.swift +++ b/ArkKit/Sources/ArkKit/ark-multiplayer-kit/ArkNetworkService.swift @@ -1,7 +1,4 @@ -#if canImport(UIKit) import UIKit -#endif - import P2PShare /** diff --git a/ArkKit/Sources/ArkKit/ark-physics-kit/PhysicsComponent.swift b/ArkKit/Sources/ArkKit/ark-physics-kit/PhysicsComponent.swift index 0142c42..a39bf7a 100644 --- a/ArkKit/Sources/ArkKit/ark-physics-kit/PhysicsComponent.swift +++ b/ArkKit/Sources/ArkKit/ark-physics-kit/PhysicsComponent.swift @@ -15,16 +15,16 @@ public struct PhysicsComponent: SendableComponent { public var vertices: [CGPoint]? public var mass: CGFloat? - public var velocity: CGVector = .zero - public var isDynamic = true - public var affectedByGravity = false - public var linearDamping: CGFloat = .zero - public var angularDamping: CGFloat = .zero - public var allowsRotation = false - public var friction: CGFloat = .zero - public var restitution: CGFloat = .zero - public var impulse: CGVector = .zero - public var angularImpulse: CGFloat = .zero + public var velocity: CGVector + public var isDynamic: Bool + public var affectedByGravity: Bool + public var linearDamping: CGFloat + public var angularDamping: CGFloat + public var allowsRotation: Bool + public var friction: CGFloat + public var restitution: CGFloat + public var impulse: CGVector + public var angularImpulse: CGFloat public var categoryBitMask: UInt32 public var collisionBitMask: UInt32 diff --git a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/CircleRenderableComponent.swift b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/CircleRenderableComponent.swift index 9740e37..3dea4bd 100644 --- a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/CircleRenderableComponent.swift +++ b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/CircleRenderableComponent.swift @@ -16,8 +16,8 @@ public struct CircleRenderableComponent: ShapeRenderableComponent { public var labelInfo: ShapeLabelInfo? public init(radius: Double, fillInfo: ShapeFillInfo? = nil, - strokeInfo: ShapeStrokeInfo? = nil, - labelInfo: ShapeLabelInfo? = nil) { + strokeInfo: ShapeStrokeInfo? = nil, + labelInfo: ShapeLabelInfo? = nil) { self.radius = radius self.fillInfo = fillInfo self.strokeInfo = strokeInfo @@ -25,7 +25,7 @@ public struct CircleRenderableComponent: ShapeRenderableComponent { } public func modify(fillInfo: ShapeFillInfo?, strokeInfo: ShapeStrokeInfo?, - labelInfo: ShapeLabelInfo?) -> CircleRenderableComponent { + labelInfo: ShapeLabelInfo?) -> CircleRenderableComponent { var copy = self copy.fillInfo = fillInfo copy.strokeInfo = strokeInfo diff --git a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/PolygonRenderableComponent.swift b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/PolygonRenderableComponent.swift index 60878ff..63dcbf9 100644 --- a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/PolygonRenderableComponent.swift +++ b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/PolygonRenderableComponent.swift @@ -17,9 +17,9 @@ public struct PolygonRenderableComponent: ShapeRenderableComponent { public var labelInfo: ShapeLabelInfo? public init(points: [CGPoint], frame: CGRect, - fillInfo: ShapeFillInfo? = nil, - strokeInfo: ShapeStrokeInfo? = nil, - labelInfo: ShapeLabelInfo? = nil) { + fillInfo: ShapeFillInfo? = nil, + strokeInfo: ShapeStrokeInfo? = nil, + labelInfo: ShapeLabelInfo? = nil) { self.points = points self.frame = frame self.center = CGPoint(x: frame.midX, y: frame.midY) @@ -29,7 +29,7 @@ public struct PolygonRenderableComponent: ShapeRenderableComponent { } public func modify(fillInfo: ShapeFillInfo?, strokeInfo: ShapeStrokeInfo?, - labelInfo: ShapeLabelInfo?) -> PolygonRenderableComponent { + labelInfo: ShapeLabelInfo?) -> PolygonRenderableComponent { var copy = self copy.fillInfo = fillInfo diff --git a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/RectRenderableComponent.swift b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/RectRenderableComponent.swift index afa59fa..de364ce 100644 --- a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/RectRenderableComponent.swift +++ b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/RectRenderableComponent.swift @@ -17,9 +17,9 @@ public struct RectRenderableComponent: ShapeRenderableComponent { public var labelInfo: ShapeLabelInfo? public init(width: Double, height: Double, - fillInfo: ShapeFillInfo? = nil, - strokeInfo: ShapeStrokeInfo? = nil, - labelInfo: ShapeLabelInfo? = nil) { + fillInfo: ShapeFillInfo? = nil, + strokeInfo: ShapeStrokeInfo? = nil, + labelInfo: ShapeLabelInfo? = nil) { self.width = width self.height = height self.fillInfo = fillInfo diff --git a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/ShapeRenderableComponent.swift b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/ShapeRenderableComponent.swift index ce4c189..acc00ae 100644 --- a/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/ShapeRenderableComponent.swift +++ b/ArkKit/Sources/ArkKit/ark-render-kit/renderable-components/shapes/ShapeRenderableComponent.swift @@ -1,6 +1,7 @@ import Foundation -public protocol ShapeRenderableComponent: AbstractShape, AbstractTappable, RenderableComponent where Color == AbstractColor { +public protocol ShapeRenderableComponent: AbstractShape, AbstractTappable, + RenderableComponent where Color == AbstractColor { var fillInfo: ShapeFillInfo? { get } var strokeInfo: ShapeStrokeInfo? { get } var labelInfo: ShapeLabelInfo? { get } @@ -26,7 +27,7 @@ extension ShapeRenderableComponent { } public func upsert(fillInfo: ShapeFillInfo? = nil, strokeInfo: ShapeStrokeInfo? = nil, - labelInfo: ShapeLabelInfo? = nil) -> Self { + labelInfo: ShapeLabelInfo? = nil) -> Self { modify( fillInfo: fillInfo ?? self.fillInfo, strokeInfo: strokeInfo ?? self.strokeInfo, diff --git a/ArkKit/Tests/ArkKitTests/ark-event-kit-tests/ArkEventKitTests.swift b/ArkKit/Tests/ArkKitTests/ark-event-kit-tests/ArkEventKitTests.swift index 18075e9..4e5d3ab 100644 --- a/ArkKit/Tests/ArkKitTests/ark-event-kit-tests/ArkEventKitTests.swift +++ b/ArkKit/Tests/ArkKitTests/ark-event-kit-tests/ArkEventKitTests.swift @@ -151,7 +151,8 @@ class ArkEventKitTests: XCTestCase { eventManager.processEvents() XCTAssertTrue(modificationFlag, "The event listener should have been called and attempted a modification") - XCTAssertEqual(event.priority, 1, "The original event's priority should remain unchanged after listener execution") + XCTAssertEqual(event.priority, 1, + "The original event's priority should remain unchanged after listener execution") } func testProcessingEventsGeneratesNewEvents() { diff --git a/ArkKit/Tests/ArkKitTests/ark-multiplayer-kit-tests/ArkHostSystemTests.swift b/ArkKit/Tests/ArkKitTests/ark-multiplayer-kit-tests/ArkHostSystemTests.swift index 78d7095..710ec82 100644 --- a/ArkKit/Tests/ArkKitTests/ark-multiplayer-kit-tests/ArkHostSystemTests.swift +++ b/ArkKit/Tests/ArkKitTests/ark-multiplayer-kit-tests/ArkHostSystemTests.swift @@ -11,7 +11,8 @@ class ArkHostSystemTests: XCTestCase { hostSystem.update(deltaTime: 0.16, arkECS: mockECS) XCTAssertNotNil(mockPublisher.publishedECS, "The ECS should have been published") - XCTAssertTrue(mockPublisher.publishedECS === mockECS, "The published ECS should be the same instance as provided") + XCTAssertTrue(mockPublisher.publishedECS === mockECS, + "The published ECS should be the same instance as provided") } func testSystemIsActive() {