Skip to content

Commit

Permalink
docs: Rename caveace asset to cave_ace in our examples (#2304)
Browse files Browse the repository at this point in the history
I am on a crusade to improve our spellchecking. I have a big PR that I am now going to break down into very small chunks to for review.

Here I am renaming an asset to include a word separator, as the combined word "caveace" doesn't exist. This not only allows us to remove one unclear entry in our dictionary, but make our example code easier to read for new users.

Note: in order to easily update the internal name of the atlas (unrelated to file name), that is stored in the binary, I used this pending feature from Fire Atlas.
  • Loading branch information
luanpotter committed Feb 4, 2023
1 parent 6704753 commit e2399f9
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/.cspell/flame_dictionary.txt
Expand Up @@ -18,7 +18,6 @@ Tiled
Tiled's
Tilemap
Wyrmsun
caveace
erayzesen
padracing
ptero
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/flame/test/cache/assets_cache_test.dart
Expand Up @@ -34,12 +34,12 @@ void main() {

test('readBinaryFile', () async {
final assetsCache = AssetsCache(prefix: '');
final fileName = fixture('caveace.fa').path;
final fileName = fixture('cave_ace.fa').path;
final file = await assetsCache.readBinaryFile(fileName);
expect(file, isA<Uint8List>());

expect(
() async => assetsCache.readFile(fixture('caveace.fa').path),
() async => assetsCache.readFile(fixture('cave_ace.fa').path),
failsAssert('"$fileName" was previously loaded as a binary file'),
);
});
Expand Down
Binary file not shown.
Binary file removed packages/flame_fire_atlas/example/assets/caveace.fa
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/flame_fire_atlas/example/lib/main.dart
Expand Up @@ -16,7 +16,7 @@ class ExampleGame extends FlameGame with TapDetector {

@override
Future<void> onLoad() async {
_atlas = await loadFireAtlas('caveace.fa');
_atlas = await loadFireAtlas('cave_ace.fa');
add(
SpriteAnimationComponent(
size: Vector2(150, 100),
Expand Down
2 changes: 1 addition & 1 deletion packages/flame_fire_atlas/example/pubspec.yaml
Expand Up @@ -22,4 +22,4 @@ dev_dependencies:
flutter:
uses-material-design: true
assets:
- assets/caveace.fa
- assets/cave_ace.fa
6 changes: 3 additions & 3 deletions packages/flame_fire_atlas/test/flame_fire_atlas_test.dart
Expand Up @@ -26,7 +26,7 @@ class MockedGame extends Mock implements FlameGame {
}

Future<Uint8List> readExampleFile() async {
final exampleAtlas = File('./example/assets/caveace.fa');
final exampleAtlas = File('./example/assets/cave_ace.fa');
final bytes = await exampleAtlas.readAsBytes();
return bytes;
}
Expand Down Expand Up @@ -58,7 +58,7 @@ void main() {
group('FireAtlas', () {
test('can load the asset', () async {
final atlas = await readTestAtlas();
expect(atlas.id, 'caveace');
expect(atlas.id, 'cave_ace');
});

test('can load the asset using the global assets/images', () async {
Expand Down Expand Up @@ -139,7 +139,7 @@ void main() {
test('converts to json', () async {
final atlas = await readTestAtlas();
final json = atlas.toJson();
expect(json['id'], 'caveace');
expect(json['id'], 'cave_ace');
});

test('serialize/deserialize', () async {
Expand Down

0 comments on commit e2399f9

Please sign in to comment.