[MetaballsKit] Make Field a class

This commit is contained in:
Eryn Wells 2017-08-01 07:54:29 -07:00
parent fda6890669
commit 2e70c76fb0

View file

@ -28,7 +28,7 @@ public struct Ball {
} }
} }
public struct Field { public class Field {
public var size: CGSize { public var size: CGSize {
didSet { didSet {
// Remove balls that fall outside the new bounds. // Remove balls that fall outside the new bounds.
@ -70,11 +70,7 @@ public struct Field {
} }
} }
public func sample(at point: CGPoint) throws -> CGFloat { public func add(ball: Ball) throws {
return 0.0
}
public mutating func add(ball: Ball) throws {
guard bounds.contains(ball.bounds) else { guard bounds.contains(ball.bounds) else {
/// TODO: Throw an error. /// TODO: Throw an error.
return return