<commit_before>//
//  Model.swift
//  SwiftGraphics
//
//  Created by <NAME> on 2/1/15.
//  Copyright (c) 2015 schwa.io. All rights reserved.
//

import Foundation

import SwiftGraphics

class Model: NSObject {
    dynamic var objects:[Thing] = []
    var selectedObjectIndices:NSMutableIndexSet = NSMutableIndexSet()
    var selectedObjects:[Thing] {
        get {
            var objects:[Thing] = []
            selectedObjectIndices.with(maxCount: 512) {
                for N in $0 {
                    objects.append(self.objects[N])
                }
            }
            return objects
        }
    }

    override init() {
    }

    func hitTest(location:CGPoint) -> (Int, Thing)? {
        for (index, thing) in enumerate(objects) {
            if thing.contains(location) {
                return (index, thing)
            }
        }<commit_msg>Swift 1.2: Added comment about dynamic.<commit_after>//
//  Model.swift
//  SwiftGraphics
//
//  Created by <NAME> on 2/1/15.
//  Copyright (c) 2015 schwa.io. All rights reserved.
//

import Foundation

import SwiftGraphics

class Model: NSObject {
    // TODO: Swift 1.2 Dynamic doesn't work with Swift 1.2
    dynamic var objects:[Thing] = []
    var selectedObjectIndices:NSMutableIndexSet = NSMutableIndexSet()
    var selectedObjects:[Thing] {
        get {
            var objects:[Thing] = []
            selectedObjectIndices.with(maxCount: 512) {
                for N in $0 {
                    objects.append(self.objects[N])
                }
            }
            return objects
        }
    }

    override init() {
    }

    func hitTest(location:CGPoint) -> (Int, Thing)? {
        for (index, thing) in enumerate(objects) {
            if thing.contains(location) {
                return (index, thing)
            }
        }
{'fraction_non_alphanumeric': 0.11172261970280682, 'fraction_numerical': 0.01651073197578426, 'mean_word_length': 1.7297297297297298, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2961100', 'n_tokens_mistral': 568, 'n_tokens_neox': 509, 'n_words': 130}