<commit_before>//
//  PhysicsBodyCategory.swift
//  AntlerKit
//
//  Created by <NAME> on 1/3/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit

public struct PhysicsBodyCategory : OptionSet, Hashable {
	
	internal static var collisions	= [PhysicsBodyCategory : Set<PhysicsBodyCategory>]()
	internal static var contacts	= [PhysicsBodyCategory : Set<PhysicsBodyCategory>]()
	
	public let rawValue : UInt32
	public var hashValue : Int {
		return rawValue.hashValue
	}
	
	public init(rawValue: UInt32) {
		self.rawValue = rawValue
	}
	public init(_ categories: PhysicsBodyCategory...) {
		self.rawValue = categories.reduce(PhysicsBodyCategory.none,
			{ result, next -> PhysicsBodyCategory in
				return result.union(next)
			}).rawValue
	}
	
}

// MARK: - Built In Categories
public extension PhysicsBodyCategory {
	
	public static let none	= PhysicsBodyCategory(rawValue: UInt32.allZeros)
	public static let all 	= PhysicsBodyCategory(rawValue: ~UInt32.allZeros)
	
}<commit_msg>easy init for new PhysicsBodyCategories<commit_after>//
//  PhysicsBodyCategory.swift
//  AntlerKit
//
//  Created by <NAME> on 1/3/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit

public struct PhysicsBodyCategory : OptionSet, Hashable {
	
	internal static var collisions	= [PhysicsBodyCategory : Set<PhysicsBodyCategory>]()
	internal static var contacts	= [PhysicsBodyCategory : Set<PhysicsBodyCategory>]()
	
	public let rawValue : UInt32
	public var hashValue : Int {
		return rawValue.hashValue
	}
	
	public init(rawValue: UInt32) {
		self.rawValue = rawValue
	}
	public init(_ categories: PhysicsBodyCategory...) {
		self.rawValue = categories.reduce(PhysicsBodyCategory.none,
			{ result, next -> PhysicsBodyCategory in
				return result.union(next)
			}).rawValue
	}
	
	public init(uniqueInt1Through32 index: UInt32) {
		if index == 0 || index > 32 { fatalError("PhysicsBodyCategory index must be within 1...32") }
		self.init(rawValue: 1 << (index - 1))
	}
	
}

// MARK: - Built In Categories
public extension PhysicsBodyCategory {
	
	public static let none	= PhysicsBodyCategory(rawValue: UInt32.allZeros)
	public static let all 	= PhysicsBodyCategory(rawValue: ~UInt32.allZeros)
	
}
{'fraction_non_alphanumeric': 0.10190518387239698, 'fraction_numerical': 0.01993797075764289, 'mean_word_length': 4.155251141552512, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4887584', 'n_tokens_mistral': 781, 'n_tokens_neox': 684, 'n_words': 189}