<commit_before>part of entity_component;

class Entity {

  World world;
  Map<Type, Component> components;

  Entity(World world) {
    this.world = world;
    components = new Map();
  }

  void add_to_world() {
    world._add_to_world(this);
  }

  void add_component(Component c) {
    components[c.runtimeType] = c;
  }

  Component get_component(Type t) {
    return components[t];
  }

  bool has_component(Component c) {
    if (components.containsKey(c)) {
      return true;
    } else {
      return false;
    }
  }

}
<commit_msg>has_component should take a Type, i.e. Position or Selection, not an instance of Component<commit_after>part of entity_component;

class Entity {

  World world;
  Map<Type, Component> components;

  Entity(World world) {
    this.world = world;
    components = new Map();
  }

  void add_to_world() {
    world._add_to_world(this);
  }

  void add_component(Component c) {
    components[c.runtimeType] = c;
  }

  Component get_component(Type t) {
    return components[t];
  }

  bool has_component(Type t) {
    if (components.containsKey(t)) {
      return true;
    } else {
      return false;
    }
  }

}

{'fraction_non_alphanumeric': 0.10880829015544041, 'fraction_numerical': 0.0, 'mean_word_length': 2.942176870748299, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5474297', 'n_tokens_mistral': 393, 'n_tokens_neox': 380, 'n_words': 93}