Skip to content

Commit

Permalink
feat: word axis (#17)
Browse files Browse the repository at this point in the history
* chore: get dependencies

* feat: add axis to word

* chore: do not analyze generated files
  • Loading branch information
jsgalarraga authored Mar 1, 2024
1 parent beddfe4 commit c0b7b59
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 2 deletions.
4 changes: 4 additions & 0 deletions api/packages/game_domain/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml

analyzer:
exclude:
- '**/*.g.dart'
15 changes: 15 additions & 0 deletions api/packages/game_domain/lib/src/models/word.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Word extends Equatable {
const Word({
required this.id,
required this.position,
required this.axis,
required this.answer,
required this.clue,
required this.hints,
Expand All @@ -32,6 +33,10 @@ class Word extends Equatable {
@PointConverter()
final Point<int> position;

/// The axis of the word in the board.
@JsonKey()
final Axis axis;

/// The word answer to display in the crossword when solved.
@JsonKey()
final String answer;
Expand Down Expand Up @@ -62,10 +67,20 @@ class Word extends Equatable {
List<Object?> get props => [
id,
position,
axis,
answer,
clue,
hints,
visible,
solvedTimestamp,
];
}

/// The two possible axis for a word in the board.
enum Axis {
/// From left to right.
horizontal,

/// From top to bottom.
vertical,
}
7 changes: 7 additions & 0 deletions api/packages/game_domain/lib/src/models/word.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void main() {
Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'answer',
clue: 'clue',
hints: ['hints'],
Expand All @@ -37,6 +38,7 @@ void main() {
{
'id': 'id',
'position': {'x': 1, 'y': 2},
'axis': 'horizontal',
'answer': 'answer',
'clue': 'clue',
'hints': ['hints'],
Expand All @@ -58,6 +60,7 @@ void main() {
{
'id': 'id',
'position': {'x': 1, 'y': 2},
'axis': 'horizontal',
'answer': 'answer',
'clue': 'clue',
'hints': ['hints'],
Expand All @@ -79,6 +82,7 @@ void main() {
Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'answer',
clue: 'clue',
hints: ['hints'],
Expand Down
6 changes: 6 additions & 0 deletions api/packages/game_domain/test/src/models/word_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ void main() {
final word = Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'test',
clue: 'clue',
hints: const ['hint'],
Expand All @@ -22,6 +23,7 @@ void main() {
equals({
'id': 'id',
'position': {'x': 1, 'y': 2},
'axis': 'horizontal',
'answer': 'test',
'clue': 'clue',
'hints': ['hint'],
Expand All @@ -35,6 +37,7 @@ void main() {
final json = {
'id': 'id',
'position': {'x': 1, 'y': 2},
'axis': 'horizontal',
'answer': 'test',
'clue': 'clue',
'hints': ['hint'],
Expand All @@ -47,6 +50,7 @@ void main() {
Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'test',
clue: 'clue',
hints: const ['hint'],
Expand All @@ -61,6 +65,7 @@ void main() {
final firstWord = Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'test',
clue: 'clue',
hints: const ['hint'],
Expand All @@ -70,6 +75,7 @@ void main() {
final secondWord = Word(
id: 'id',
position: Point(1, 2),
axis: Axis.horizontal,
answer: 'test',
clue: 'clue',
hints: const ['hint'],
Expand Down
4 changes: 4 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
import FlutterMacOS
import Foundation

import audioplayers_darwin
import firebase_auth
import firebase_core
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
Loading

0 comments on commit c0b7b59

Please sign in to comment.