getMostUsedArchetypes method

List<ArchetypeEntry> getMostUsedArchetypes({
  1. int limit = 10,
})

Implementation

List<ArchetypeEntry> getMostUsedArchetypes({int limit = 10}) {
  final entries = _entityCounts.entries
      .map((e) => ArchetypeEntry(e.key, e.value))
      .toList();
  entries.sort((a, b) => b.count.compareTo(a.count));
  return entries.take(limit).toList();
}