Moved data types to its own package and added empty synth package

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-15 11:51:18 +01:00
parent e6fa4b761e
commit 0e7d953ec5
28 changed files with 224 additions and 23 deletions

View File

@@ -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 {

View File

@@ -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.

View File

@@ -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<Map<GameVersion, WolfensteinData>> discoverInDirectory({

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.

View File

@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/to/develop-packages).
-->
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.

View File

@@ -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

View File

@@ -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;

View File

@@ -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

7
packages/wolf_3d_synth/.gitignore vendored Normal file
View File

@@ -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

View File

@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.

View File

@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/to/develop-packages).
-->
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.

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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.

View File

@@ -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

View File

@@ -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/*