From 2e70c76fb021e2b98a81a631b6b2eb9afaa09443 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 1 Aug 2017 07:54:29 -0700 Subject: [PATCH] [MetaballsKit] Make Field a class --- MetaballsKit/Metaballs.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/MetaballsKit/Metaballs.swift b/MetaballsKit/Metaballs.swift index dc638d9..c7ba542 100644 --- a/MetaballsKit/Metaballs.swift +++ b/MetaballsKit/Metaballs.swift @@ -28,7 +28,7 @@ public struct Ball { } } -public struct Field { +public class Field { public var size: CGSize { didSet { // Remove balls that fall outside the new bounds. @@ -70,11 +70,7 @@ public struct Field { } } - public func sample(at point: CGPoint) throws -> CGFloat { - return 0.0 - } - - public mutating func add(ball: Ball) throws { + public func add(ball: Ball) throws { guard bounds.contains(ball.bounds) else { /// TODO: Throw an error. return