Skip to content

Commit

Permalink
optimise code
Browse files Browse the repository at this point in the history
- clean up dependencies
- running dartfmt
  • Loading branch information
mars3142 committed Mar 25, 2020
1 parent 7a80401 commit 6da4948
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 162 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.2-dev

- code cleanup
- remove unused dependencies

## 0.0.1-dev

It's a partial port of https://github.com/mars3142/wherugo, so everyone can decode [Wherigo Cartridges](https://www.wherigo.com/).
2 changes: 1 addition & 1 deletion lib/src/models/cartridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Cartridge {
// initialise objects after cartridge data is loaded
var objects = <int, Media>{};
references.forEach((index, address) =>
{objects.putIfAbsent(index, () => Media(reader, index, address))});
{objects.putIfAbsent(index, () => Media(reader, index, address))});

return Cartridge._(
cartridgeGuid,
Expand Down
12 changes: 12 additions & 0 deletions lib/src/models/media.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,40 @@ String _getObjectType(int objectType) {
enum ObjectType {
/// object is deleted
deleted,

/// object is compiled lua code
luac,

/// object is a BMP file
bmp,

/// object is a PNG file
png,

/// object is a JPEG file
jpg,

/// object is a GIF file
gif,

/// object is a WAV file
wav,

/// object is a MP3 file
mp3,

/// object is a FDL file
fdl,

/// object is a SND file
snd,

/// object is a OGG file
ogg,

/// object is a SWF file
swf,

/// object is a TXT file
txt
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Cartridge parseData(Uint8List bytes) {
}

return Cartridge(reader);
} on Exception catch(_) {
} on Exception catch (_) {
return null;
}
}
154 changes: 0 additions & 154 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.38.5"
analyzer_plugin:
dependency: transitive
description:
name: analyzer_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
args:
dependency: transitive
description:
Expand All @@ -36,90 +29,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.2"
built_collection:
dependency: "direct main"
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.2"
built_value:
dependency: "direct main"
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "6.8.2"
built_value_generator:
dependency: "direct dev"
description:
name: built_value_generator
url: "https://pub.dartlang.org"
source: hosted
version: "6.8.2"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -155,27 +71,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
effective_dart:
dependency: "direct dev"
description:
name: effective_dart
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.11"
front_end:
dependency: transitive
description:
Expand All @@ -190,13 +92,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
html:
dependency: transitive
description:
Expand Down Expand Up @@ -239,13 +134,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+1"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
kernel:
dependency: transitive
description:
Expand Down Expand Up @@ -323,13 +211,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.1"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path:
dependency: "direct main"
description:
Expand Down Expand Up @@ -358,20 +239,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
shelf:
dependency: transitive
description:
Expand Down Expand Up @@ -400,13 +267,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+6"
source_map_stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -442,13 +302,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.20"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -484,13 +337,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+2"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 2 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: freewig
version: 0.0.1-dev
version: 0.0.2-dev
description: >
The library freewig will help to use Wherigo caches in Dart or Flutter
homepage: https://github.com/mars3142/freewig
Expand All @@ -8,14 +8,10 @@ environment:
sdk: '>=2.7.0 <3.0.0'

dependencies:
built_collection: ^4.3.2
built_value: ^6.8.2
meta: ^1.1.8
path: ^1.6.0

dev_dependencies:
build_runner: ^1.8.0
built_value_generator: ^6.8.2
effective_dart: ^1.0.0
test: ^1.6.0
mockito: ^4.0.0
mockito: ^4.0.0

0 comments on commit 6da4948

Please sign in to comment.