From 0e7d953ec5aa5b83c6b48ad699477a3a6245bcdf Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Sun, 15 Mar 2026 11:51:18 +0100 Subject: [PATCH] Moved data types to its own package and added empty synth package Signed-off-by: Hans Kokx --- lib/game_select_screen.dart | 1 + .../wolf_3d_data/lib/src/io/discovery_io.dart | 5 +-- .../lib/src/io/discovery_stub.dart | 3 +- packages/wolf_3d_data/lib/src/wl_parser.dart | 8 +--- .../lib/src/wolfenstein_loader.dart | 4 +- packages/wolf_3d_data/lib/wolf_3d_data.dart | 8 ---- packages/wolf_3d_data/pubspec.yaml | 5 +++ packages/wolf_3d_data_types/.gitignore | 7 ++++ packages/wolf_3d_data_types/CHANGELOG.md | 3 ++ packages/wolf_3d_data_types/README.md | 39 +++++++++++++++++++ .../wolf_3d_data_types/analysis_options.yaml | 30 ++++++++++++++ .../lib/src}/game_file.dart | 0 .../lib/src}/game_version.dart | 0 .../lib/src}/image.dart | 0 .../lib/src}/sound.dart | 0 .../lib/src}/sprite.dart | 0 .../lib/src}/wolf_level.dart | 0 .../lib/src}/wolfenstein_data.dart | 0 .../lib/wolf_3d_data_types.dart | 12 ++++++ packages/wolf_3d_data_types/pubspec.yaml | 13 +++++++ packages/wolf_3d_synth/.gitignore | 7 ++++ packages/wolf_3d_synth/CHANGELOG.md | 3 ++ packages/wolf_3d_synth/README.md | 39 +++++++++++++++++++ packages/wolf_3d_synth/analysis_options.yaml | 30 ++++++++++++++ .../lib/src/wolf_3d_synth_base.dart | 6 +++ packages/wolf_3d_synth/lib/wolf_3d_synth.dart | 8 ++++ packages/wolf_3d_synth/pubspec.yaml | 13 +++++++ pubspec.yaml | 3 +- 28 files changed, 224 insertions(+), 23 deletions(-) create mode 100644 packages/wolf_3d_data_types/.gitignore create mode 100644 packages/wolf_3d_data_types/CHANGELOG.md create mode 100644 packages/wolf_3d_data_types/README.md create mode 100644 packages/wolf_3d_data_types/analysis_options.yaml rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/game_file.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/game_version.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/image.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/sound.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/sprite.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/wolf_level.dart (100%) rename packages/{wolf_3d_data/lib/src/classes => wolf_3d_data_types/lib/src}/wolfenstein_data.dart (100%) create mode 100644 packages/wolf_3d_data_types/lib/wolf_3d_data_types.dart create mode 100644 packages/wolf_3d_data_types/pubspec.yaml create mode 100644 packages/wolf_3d_synth/.gitignore create mode 100644 packages/wolf_3d_synth/CHANGELOG.md create mode 100644 packages/wolf_3d_synth/README.md create mode 100644 packages/wolf_3d_synth/analysis_options.yaml create mode 100644 packages/wolf_3d_synth/lib/src/wolf_3d_synth_base.dart create mode 100644 packages/wolf_3d_synth/lib/wolf_3d_synth.dart create mode 100644 packages/wolf_3d_synth/pubspec.yaml diff --git a/lib/game_select_screen.dart b/lib/game_select_screen.dart index 346341e..ce151fe 100644 --- a/lib/game_select_screen.dart +++ b/lib/game_select_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:wolf_3d_data/wolf_3d_data.dart'; +import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; import 'package:wolf_dart/features/difficulty/difficulty_screen.dart'; class GameSelectScreen extends StatelessWidget { diff --git a/packages/wolf_3d_data/lib/src/io/discovery_io.dart b/packages/wolf_3d_data/lib/src/io/discovery_io.dart index 05f7ed0..1dd6a98 100644 --- a/packages/wolf_3d_data/lib/src/io/discovery_io.dart +++ b/packages/wolf_3d_data/lib/src/io/discovery_io.dart @@ -1,9 +1,8 @@ import 'dart:io'; import 'dart:typed_data'; -import '../classes/game_file.dart'; -import '../classes/game_version.dart'; -import '../classes/wolfenstein_data.dart'; +import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; + import '../wl_parser.dart'; /// dart:io implementation for directory discovery. diff --git a/packages/wolf_3d_data/lib/src/io/discovery_stub.dart b/packages/wolf_3d_data/lib/src/io/discovery_stub.dart index f420637..454a41e 100644 --- a/packages/wolf_3d_data/lib/src/io/discovery_stub.dart +++ b/packages/wolf_3d_data/lib/src/io/discovery_stub.dart @@ -1,5 +1,4 @@ -import '../classes/game_version.dart'; -import '../classes/wolfenstein_data.dart'; +import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; /// Web-safe stub for directory discovery. Future> discoverInDirectory({ diff --git a/packages/wolf_3d_data/lib/src/wl_parser.dart b/packages/wolf_3d_data/lib/src/wl_parser.dart index d195360..cb2883a 100644 --- a/packages/wolf_3d_data/lib/src/wl_parser.dart +++ b/packages/wolf_3d_data/lib/src/wl_parser.dart @@ -1,13 +1,7 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:wolf_3d_data/src/classes/game_version.dart'; -import 'package:wolf_3d_data/src/classes/image.dart'; -import 'package:wolf_3d_data/src/classes/sound.dart'; -import 'package:wolf_3d_data/src/classes/wolf_level.dart'; -import 'package:wolf_3d_data/src/classes/wolfenstein_data.dart'; - -import 'classes/sprite.dart'; +import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; abstract class WLParser { /// Asynchronously discovers the game version and loads all necessary files. diff --git a/packages/wolf_3d_data/lib/src/wolfenstein_loader.dart b/packages/wolf_3d_data/lib/src/wolfenstein_loader.dart index dcda9d9..893d1b0 100644 --- a/packages/wolf_3d_data/lib/src/wolfenstein_loader.dart +++ b/packages/wolf_3d_data/lib/src/wolfenstein_loader.dart @@ -1,9 +1,9 @@ import 'dart:typed_data'; -import 'classes/game_version.dart'; -import 'classes/wolfenstein_data.dart'; // --- The Magic Conditional Import --- // If dart:io is available, use the real scanner. Otherwise, use the stub. +import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; + import 'io/discovery_stub.dart' if (dart.library.io) 'io/discovery_io.dart' as platform; diff --git a/packages/wolf_3d_data/lib/wolf_3d_data.dart b/packages/wolf_3d_data/lib/wolf_3d_data.dart index 2996597..0ada12c 100644 --- a/packages/wolf_3d_data/lib/wolf_3d_data.dart +++ b/packages/wolf_3d_data/lib/wolf_3d_data.dart @@ -3,13 +3,5 @@ /// More dartdocs go here. library; -export 'src/classes/game_file.dart' show GameFile; -export 'src/classes/game_version.dart' show GameVersion; -export 'src/classes/image.dart' show VgaImage; -export 'src/classes/sound.dart' - show PcmSound, AdLibSound, ImfMusic, ImfInstruction; -export 'src/classes/sprite.dart' hide Matrix; -export 'src/classes/wolf_level.dart' show WolfLevel; -export 'src/classes/wolfenstein_data.dart' show WolfensteinData; export 'src/wl_parser.dart' show WLParser; export 'src/wolfenstein_loader.dart' show WolfensteinLoader; diff --git a/packages/wolf_3d_data/pubspec.yaml b/packages/wolf_3d_data/pubspec.yaml index e6e4cf6..deefd2e 100644 --- a/packages/wolf_3d_data/pubspec.yaml +++ b/packages/wolf_3d_data/pubspec.yaml @@ -8,6 +8,11 @@ environment: resolution: workspace +publish_to: none + +dependencies: + wolf_3d_data_types: + dev_dependencies: lints: ^6.0.0 test: ^1.25.6 diff --git a/packages/wolf_3d_data_types/.gitignore b/packages/wolf_3d_data_types/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/wolf_3d_data_types/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/wolf_3d_data_types/CHANGELOG.md b/packages/wolf_3d_data_types/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/packages/wolf_3d_data_types/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/packages/wolf_3d_data_types/README.md b/packages/wolf_3d_data_types/README.md new file mode 100644 index 0000000..8831761 --- /dev/null +++ b/packages/wolf_3d_data_types/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/wolf_3d_data_types/analysis_options.yaml b/packages/wolf_3d_data_types/analysis_options.yaml new file mode 100644 index 0000000..dee8927 --- /dev/null +++ b/packages/wolf_3d_data_types/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/packages/wolf_3d_data/lib/src/classes/game_file.dart b/packages/wolf_3d_data_types/lib/src/game_file.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/game_file.dart rename to packages/wolf_3d_data_types/lib/src/game_file.dart diff --git a/packages/wolf_3d_data/lib/src/classes/game_version.dart b/packages/wolf_3d_data_types/lib/src/game_version.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/game_version.dart rename to packages/wolf_3d_data_types/lib/src/game_version.dart diff --git a/packages/wolf_3d_data/lib/src/classes/image.dart b/packages/wolf_3d_data_types/lib/src/image.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/image.dart rename to packages/wolf_3d_data_types/lib/src/image.dart diff --git a/packages/wolf_3d_data/lib/src/classes/sound.dart b/packages/wolf_3d_data_types/lib/src/sound.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/sound.dart rename to packages/wolf_3d_data_types/lib/src/sound.dart diff --git a/packages/wolf_3d_data/lib/src/classes/sprite.dart b/packages/wolf_3d_data_types/lib/src/sprite.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/sprite.dart rename to packages/wolf_3d_data_types/lib/src/sprite.dart diff --git a/packages/wolf_3d_data/lib/src/classes/wolf_level.dart b/packages/wolf_3d_data_types/lib/src/wolf_level.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/wolf_level.dart rename to packages/wolf_3d_data_types/lib/src/wolf_level.dart diff --git a/packages/wolf_3d_data/lib/src/classes/wolfenstein_data.dart b/packages/wolf_3d_data_types/lib/src/wolfenstein_data.dart similarity index 100% rename from packages/wolf_3d_data/lib/src/classes/wolfenstein_data.dart rename to packages/wolf_3d_data_types/lib/src/wolfenstein_data.dart diff --git a/packages/wolf_3d_data_types/lib/wolf_3d_data_types.dart b/packages/wolf_3d_data_types/lib/wolf_3d_data_types.dart new file mode 100644 index 0000000..22fb698 --- /dev/null +++ b/packages/wolf_3d_data_types/lib/wolf_3d_data_types.dart @@ -0,0 +1,12 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library; + +export 'src/game_file.dart' show GameFile; +export 'src/game_version.dart' show GameVersion; +export 'src/image.dart' show VgaImage; +export 'src/sound.dart' show PcmSound, AdLibSound, ImfMusic, ImfInstruction; +export 'src/sprite.dart' hide Matrix; +export 'src/wolf_level.dart' show WolfLevel; +export 'src/wolfenstein_data.dart' show WolfensteinData; diff --git a/packages/wolf_3d_data_types/pubspec.yaml b/packages/wolf_3d_data_types/pubspec.yaml new file mode 100644 index 0000000..d541e72 --- /dev/null +++ b/packages/wolf_3d_data_types/pubspec.yaml @@ -0,0 +1,13 @@ +name: wolf_3d_data_types +description: A starting point for Dart libraries or applications. +version: 1.0.0 +# repository: https://github.com/my_org/my_repo + +environment: + sdk: ^3.11.1 + +resolution: workspace + +dev_dependencies: + lints: ^6.0.0 + test: ^1.25.6 diff --git a/packages/wolf_3d_synth/.gitignore b/packages/wolf_3d_synth/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/wolf_3d_synth/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/wolf_3d_synth/CHANGELOG.md b/packages/wolf_3d_synth/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/packages/wolf_3d_synth/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/packages/wolf_3d_synth/README.md b/packages/wolf_3d_synth/README.md new file mode 100644 index 0000000..8831761 --- /dev/null +++ b/packages/wolf_3d_synth/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/wolf_3d_synth/analysis_options.yaml b/packages/wolf_3d_synth/analysis_options.yaml new file mode 100644 index 0000000..dee8927 --- /dev/null +++ b/packages/wolf_3d_synth/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/packages/wolf_3d_synth/lib/src/wolf_3d_synth_base.dart b/packages/wolf_3d_synth/lib/src/wolf_3d_synth_base.dart new file mode 100644 index 0000000..e8a6f15 --- /dev/null +++ b/packages/wolf_3d_synth/lib/src/wolf_3d_synth_base.dart @@ -0,0 +1,6 @@ +// TODO: Put public facing types in this file. + +/// Checks if you are awesome. Spoiler: you are. +class Awesome { + bool get isAwesome => true; +} diff --git a/packages/wolf_3d_synth/lib/wolf_3d_synth.dart b/packages/wolf_3d_synth/lib/wolf_3d_synth.dart new file mode 100644 index 0000000..8fc6887 --- /dev/null +++ b/packages/wolf_3d_synth/lib/wolf_3d_synth.dart @@ -0,0 +1,8 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library; + +export 'src/wolf_3d_synth_base.dart'; + +// TODO: Export any libraries intended for clients of this package. diff --git a/packages/wolf_3d_synth/pubspec.yaml b/packages/wolf_3d_synth/pubspec.yaml new file mode 100644 index 0000000..09eb946 --- /dev/null +++ b/packages/wolf_3d_synth/pubspec.yaml @@ -0,0 +1,13 @@ +name: wolf_3d_synth +description: A starting point for Dart libraries or applications. +version: 1.0.0 +# repository: https://github.com/my_org/my_repo + +environment: + sdk: ^3.11.1 + +resolution: workspace + +dev_dependencies: + lints: ^6.0.0 + test: ^1.25.6 diff --git a/pubspec.yaml b/pubspec.yaml index 69038ba..7773b71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,6 +8,7 @@ environment: dependencies: wolf_3d_data: any + wolf_3d_data_types: any flutter: sdk: flutter @@ -23,4 +24,4 @@ flutter: - assets/shareware/ workspace: - - packages/wolf_3d_data + - packages/*