<commit_before>part of libgame;

// convenience wrapper class.
class Room
{
	Entity entity;

	Room(this.entity);

	DisplayContainerComponent get display => entity.getComponentByClass(DisplayContainerComponent);

	Bag get actorEntities => (entity.getComponentByClass(EntityBagComponent) as EntityBagComponent).entities;

	Actor getActorByName(String name) {
		Entity actorEntity = actorEntities.singleWhere((Entity e) => (e.getComponentByClass(MetaComponent) as MetaComponent).meta['name'] == name);
		return new Actor(actorEntity);
	}

	List<Actor> getActorsByTag(String tag) {
		List<Entity> entities = actorEntities.where((Entity e) => (e.getComponentByClass(MetaComponent) as MetaComponent).meta['tags'].contains(tag));
		List <Actor> actors = [];
		for(Entity e in entities)
			actors.add(new Actor(e));
		return actors;
	}
}<commit_msg>fix bug: Uncaught Error: type 'WhereIterable' is not a subtype of type 'List<Entity>' of 'entities'<commit_after>part of libgame;

// convenience wrapper class.
class Room
{
	Entity entity;

	Room(this.entity);

	DisplayContainerComponent get display => entity.getComponentByClass(DisplayContainerComponent);

	Bag get actorEntities => (entity.getComponentByClass(EntityBagComponent) as EntityBagComponent).entities;

	Actor getActorByName(String name) {
		Entity actorEntity = actorEntities.singleWhere((Entity e) => (e.getComponentByClass(MetaComponent) as MetaComponent).meta['name'] == name);
		return new Actor(actorEntity);
	}

	List<Actor> getActorsByTag(String tag) {
		Iterable<Entity> entities = actorEntities.where((Entity e) => (e.getComponentByClass(MetaComponent) as MetaComponent).meta['tags'].contains(tag));
		List <Actor> actors = [];
		for(Entity e in entities)
			actors.add(new Actor(e));
		return actors;
	}
}
{'fraction_non_alphanumeric': 0.12076749435665914, 'fraction_numerical': 0.0, 'mean_word_length': 6.236734693877551, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 18, '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': '5593340', 'n_tokens_mistral': 541, 'n_tokens_neox': 517, 'n_words': 126}