<commit_before>//
//  HexagonalDirection.swift
//  Hexacon
//
//  Created by <NAME> on 05/03/16.
//  Copyright © 2016 Gautier. All rights reserved.
//

import UIKit

private extension CGFloat {
    static let horizontalPadding: CGFloat = 1.2
    static let verticalPadding: CGFloat = 1
}

enum HexagonalDirection: Int {
    
    case Right
    case RightUp
    case LeftUp
    case Left
    case LeftDown
    case RightDown
    
    /**
     increment the enum to the next move, if it reach the end it come back a the beggining
     */
    mutating func move()  {
        if self != .RightDown {
            self = HexagonalDirection(rawValue: self.rawValue + 1)!
        } else {
            self = .Right
        }
    }
    
    /**
     this this all the direction we can found in an hexagonal layout following the axial coordinate
     it's used to move to the next center on the grid
     
     - returns: a point diving the direction of the new center
     */
    func direction() -> CGPoint {
        switch self {
        case .Right:
            return CGPoint(x: .horizontalPadding,y: 0)
            
        case .RightUp:
            return CGPoint(x: .horizontalPadding/2,y: -.verticalPadding)
            
        case .LeftUp:
            return CGPoint(x: -.horizontalPadding/2,y: -.verticalPadding)
            
        case .Left:
            return CGPoint(x: -.horizontalPadding,y: 0)
            
        case .LeftDown:
            return CGPoint(x: -.horizontalPadding/2,y: .verticalPadding)
            
        case .RightDown:
            return CGPoint(x: .horizontalPadding/2,y: .verticalPadding)
            
        }
    }<commit_msg>No need for CGFloat extension<commit_after>//
//  HexagonalDirection.swift
//  Hexacon
//
//  Created by <NAME> on 05/03/16.
//  Copyright © 2016 Gautier. All rights reserved.
//

import UIKit

enum HexagonalDirection: Int {
    
    case Right
    case RightUp
    case LeftUp
    case Left
    case LeftDown
    case RightDown
    
    /**
     increment the enum to the next move, if it reach the end it come back a the beggining
     */
    mutating func move()  {
        if self != .RightDown {
            self = HexagonalDirection(rawValue: self.rawValue + 1)!
        } else {
            self = .Right
        }
    }
    
    /**
     this this all the direction we can found in an hexagonal layout following the axial coordinate
     it's used to move to the next center on the grid
     
     - returns: a point diving the direction of the new center
     */
    func direction() -> CGPoint {
        
        let horizontalPadding: CGFloat = 1.2
        let verticalPadding: CGFloat = 1
        
        switch self {
            case .Right:
                return CGPoint(x: horizontalPadding,y: 0)
            case .RightUp:
                return CGPoint(x: horizontalPadding/2,y: -verticalPadding)
            case .LeftUp:
                return CGPoint(x: -horizontalPadding/2,y: -verticalPadding)
            case .Left:
                return CGPoint(x: -horizontalPadding,y: 0)
            case .LeftDown:
                return CGPoint(x: -horizontalPadding/2,y: verticalPadding)
            case .RightDown:
                return CGPoint(x: horizontalPadding/2,y: verticalPadding)
        }
    }
{'fraction_non_alphanumeric': 0.0802675585284281, 'fraction_numerical': 0.012161751292186074, 'mean_word_length': 1.7078189300411524, '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': '7464266', 'n_tokens_mistral': 969, 'n_tokens_neox': 900, 'n_words': 307}