<commit_before>//
// Created by <NAME> on 02/02/16.
// Copyright (c) 2016 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit;
import GameplayKit;

protocol Hexagon {
  var coordinate: Axialcoordinate { get set }
}

class Tile: Hexagon {
  
  let sprite: SKSpriteNode;
  var coordinate: Axialcoordinate;
  
  var height: Float;
  
  init(atCoordinate: Axialcoordinate, height: Float) {
    self.coordinate = atCoordinate;
    sprite = SKSpriteNode(imageNamed: "Hexagon");
    sprite.position = coordinate.toWorld();
    sprite.xScale = 0.2;
    sprite.yScale = sprite.xScale;
    sprite.colorBlendFactor = 1.0;
    sprite.color = UIColor(red: CGFloat(height), green: 0.4, blue: 0.5, alpha: 1)
    
    self.height = height;
  }
}<commit_msg>Added in Tiles, Water, Land, Mountain<commit_after>//
// Created by <NAME> on 02/02/16.
// Copyright (c) 2016 <NAME>. All rights reserved.
//

import Foundation
import SpriteKit;
import GameplayKit;

protocol Hexagon {
  var coordinate: Axialcoordinate { get set }
}

enum TileType {
  case Water
  case Land
  case Mountain
}

class Tile: Hexagon {
  
  let sprite: SKSpriteNode;
  var coordinate: Axialcoordinate;
  let tileType: TileType;
  
  var height: Float;
  
  init(atCoordinate: Axialcoordinate, height: Float) {
    self.coordinate = atCoordinate;
    sprite = SKSpriteNode(imageNamed: "Hexagon");
    sprite.position = coordinate.toWorld();
    sprite.xScale = 0.2;
    sprite.yScale = sprite.xScale;
    sprite.colorBlendFactor = 1.0;
//    sprite.color = UIColor(red: CGFloat(height), green: 0.4, blue: 0.5, alpha: 1)
    
    self.height = height;

    if (height <= 0.4) { tileType = TileType.Water }
    else if (height <= 0.7) { tileType = TileType.Land }
    else { tileType = TileType.Mountain }
    
    switch (tileType) {
    case TileType.Water:
      sprite.color = UIColor(hue: 205/360.0, saturation: 0.8, brightness: CGFloat(height/0.8) + 0.35, alpha: 1.0)
      break
    case TileType.Land:
      sprite.color = UIColor(hue: 85/360.0, saturation: 1.0, brightness: CGFloat((height-0.4)/0.7) + 0.5, alpha: 1.0)
      break
    case TileType.Mountain:
      sprite.color = UIColor(hue: 0/360.0, saturation: 0, brightness: CGFloat((height-0.7)/0.9) + 0.2, alpha: 1.0)
      break
    }
  }
}
{'fraction_non_alphanumeric': 0.12884784520668427, 'fraction_numerical': 0.03869832893579595, 'mean_word_length': 3.099099099099099, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6621542', 'n_tokens_mistral': 886, 'n_tokens_neox': 824, 'n_words': 203}