Skip to content

Commit 560853c

Browse files
committed
Refactoring SJM part 1
1 parent 2405556 commit 560853c

File tree

346 files changed

+2328
-1811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+2328
-1811
lines changed

lib/data/models/database/jumps/simple_jump.g.dart renamed to lib/core/jumps/simple_jump.g.dart

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/data/models/database/jumps/simple_jump.dart renamed to lib/core/jumps/simple_jump_model.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import 'package:sj_manager/utilities/json/json_types.dart';
55
part 'simple_jump.g.dart';
66

77
@JsonSerializable()
8-
class SimpleJump with EquatableMixin {
9-
const SimpleJump({
8+
class SimpleJumpModel with EquatableMixin {
9+
const SimpleJumpModel({
1010
required this.jumperNameAndSurname,
1111
required this.distance,
1212
});
1313

1414
final String jumperNameAndSurname;
1515
final double distance;
1616

17-
static SimpleJump fromJson(Json json) => _$SimpleJumpFromJson(json);
17+
static SimpleJumpModel fromJson(Json json) => _$SimpleJumpFromJson(json);
1818

1919
Json toJson() => _$SimpleJumpToJson(this);
2020

lib/data/models/database/psyche/personalities.dart renamed to lib/core/psyche/personalities.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:sj_manager/data/models/database/psyche/level_of_consciousness.dart';
1+
import 'package:sj_manager/domain/entities/simulation/psyche/level_of_consciousness.dart';
22

33
enum Personalities {
44
compromised, // Wstyd, Skompromitowany

lib/data/models/database/team/country_team/country_team.dart renamed to lib/core/team/country_team/country_team.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import 'package:sj_manager/data/models/database/country/country.dart';
2-
import 'package:sj_manager/data/models/database/sex.dart';
3-
import 'package:sj_manager/data/models/database/team/country_team/country_team_facts.dart';
4-
import 'package:sj_manager/data/models/database/team/team.dart';
1+
import 'package:sj_manager/core/country/country.dart';
2+
import 'package:sj_manager/features/game_variants/data/models/game_variant_database.dart/sex.dart';
3+
import 'package:sj_manager/core/team/country_team/country_team_facts_model.dart';
4+
import 'package:sj_manager/domain/entities/simulation/team/team.dart';
55

66
class CountryTeam extends Team {
77
const CountryTeam({
@@ -12,7 +12,7 @@ class CountryTeam extends Team {
1212

1313
final Sex sex;
1414
final Country country;
15-
final CountryTeamFacts facts;
15+
final CountryTeamFactsModel facts;
1616

1717
@override
1818
List<Object?> get props => [
@@ -24,7 +24,7 @@ class CountryTeam extends Team {
2424
CountryTeam copyWith({
2525
Sex? sex,
2626
Country? country,
27-
CountryTeamFacts? facts,
27+
CountryTeamFactsModel? facts,
2828
}) {
2929
return CountryTeam(
3030
sex: sex ?? this.sex,

lib/data/models/database/team/country_team/country_team_facts.g.dart renamed to lib/core/team/country_team/country_team_facts.g.dart

Lines changed: 9 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/data/models/database/team/country_team/country_team_facts.dart renamed to lib/core/team/country_team/country_team_facts_model.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import 'package:equatable/equatable.dart';
22
import 'package:json_annotation/json_annotation.dart';
33
import 'package:sj_manager/utilities/json/json_types.dart';
4-
import 'package:sj_manager/data/models/database/jumps/simple_jump.dart';
5-
import 'package:sj_manager/data/models/database/team/country_team/subteam_type.dart';
4+
import 'package:sj_manager/core/jumps/simple_jump_model.dart';
5+
import 'package:sj_manager/domain/entities/simulation/team/subteam_type.dart';
66

77
part 'country_team_facts.g.dart';
88

99
@JsonSerializable()
10-
class CountryTeamFacts with EquatableMixin {
11-
const CountryTeamFacts({
10+
class CountryTeamFactsModel with EquatableMixin {
11+
const CountryTeamFactsModel({
1212
required this.stars,
1313
this.record,
1414
required this.subteams,
1515
required this.limitInSubteam,
1616
});
1717

18-
const CountryTeamFacts.empty()
18+
const CountryTeamFactsModel.empty()
1919
: this(
2020
stars: 0,
2121
record: null,
@@ -24,11 +24,11 @@ class CountryTeamFacts with EquatableMixin {
2424
);
2525

2626
final int stars;
27-
final SimpleJump? record;
27+
final SimpleJumpModel? record;
2828
final Set<SubteamType> subteams;
2929
final Map<SubteamType, int> limitInSubteam;
3030

31-
static CountryTeamFacts fromJson(Json json) => _$CountryTeamFactsFromJson(json);
31+
static CountryTeamFactsModel fromJson(Json json) => _$CountryTeamFactsFromJson(json);
3232

3333
Json toJson() => _$CountryTeamFactsToJson(this);
3434

lib/data/models/database/jumper/landing_style.dart

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/data/models/database/user_algorithms_repo.dart

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib/data/models/game_variants/game_variants_io_utils.dart renamed to lib/data/models/game_variant/game_variants_io_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'dart:io';
22

33
import 'package:sj_manager/utilities/json/db_items_json.dart';
44
import 'package:sj_manager/utilities/json/json_types.dart';
5-
import 'package:sj_manager/data/models/database/db_items_file_system_paths.dart';
5+
import 'package:sj_manager/data/repositories/db_items_file_system_paths.dart';
66
import 'package:sj_manager/utilities/utils/file_system.dart';
77
import 'package:path/path.dart' as path;
88

lib/data/models/game_variants/default_game_variants/variants_registry.dart

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/data/models/running/competition_flow_controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:sj_manager/data/models/running/competition_start_list_repository.dart';
2-
import 'package:sj_manager/data/models/simulation/competition/rules/competition_rules/default_competition_rules.dart';
3-
import 'package:sj_manager/data/models/database/jumper/jumper_db_record.dart';
4-
import 'package:sj_manager/data/models/database/team/team.dart';
2+
import 'package:sj_manager/domain/entities/simulation/competition/rules/competition_rules/default_competition_rules.dart';
3+
import 'package:sj_manager/features/game_variants/domain/entities/jumper/jumper_db_record.dart';
4+
import 'package:sj_manager/domain/entities/simulation/team/team.dart';
55

66
abstract class CompetitionFlowController<E> {
77
CompetitionFlowController({

lib/data/models/running/default_competition_flow_controllers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:sj_manager/data/models/running/competition_flow_controller.dart';
2-
import 'package:sj_manager/data/models/simulation/competition/rules/competition_round_rules/default_team_competition_round_rules.dart';
2+
import 'package:sj_manager/domain/entities/simulation/competition/rules/competition_round_rules/default_team_competition_round_rules.dart';
33

44
class DefaultIndividualCompetitionFlowController
55
extends IndividualCompetitionFlowController {

lib/data/models/simulation/competition/calendar_records/converter.dart

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/data/models/simulation/standings/score/typedefs.dart

Lines changed: 0 additions & 18 deletions
This file was deleted.

lib/data/models/training_analyzer/training_segment.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:sj_manager/data/models/simulation/flow/training/jumper_training_config.dart';
1+
import 'package:sj_manager/domain/entities/simulation/flow/training/jumper_training_config.dart';
22

33
class TrainingSegment {
44
const TrainingSegment({
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
import 'package:sj_manager/utilities/json/json_types.dart';
2-
import 'package:sj_manager/data/models/simulation/flow/simulation_mode.dart';
3-
import 'package:sj_manager/data/models/simulation/database/simulation_database_and_models/simulation_database.dart';
2+
import 'package:sj_manager/domain/entities/simulation/flow/simulation_mode.dart';
3+
import 'package:sj_manager/domain/entities/simulation/database/simulation_database_and_models/simulation_database.dart';
44

5-
class UserSimulationModel {
6-
const UserSimulationModel({
5+
class SimulationModel {
6+
const SimulationModel({
77
required this.id,
88
required this.name,
99
required this.saveTime,
1010
required this.mode,
11-
required this.subteamCountryFlagPath,
11+
required this.subteamCountryFlagName,
1212
});
1313

1414
final String id;
1515
final String name;
1616
final DateTime saveTime;
1717
final SimulationMode mode;
18-
final String? subteamCountryFlagPath;
18+
final String? subteamCountryFlagName;
1919

2020
Json toJson() {
2121
return {
2222
'id': id,
2323
'name': name,
2424
'saveTime': saveTime.toIso8601String(),
25-
'subteamCountryFlagPath': subteamCountryFlagPath,
25+
'subteamCountryFlagPath': subteamCountryFlagName,
2626
'mode': mode.name,
2727
};
2828
}
2929

30-
factory UserSimulationModel.fromJson(Map<String, dynamic> json) {
31-
return UserSimulationModel(
30+
factory SimulationModel.fromJson(Map<String, dynamic> json) {
31+
return SimulationModel(
3232
id: json['id'] as String,
3333
name: json['name'] as String,
3434
saveTime: DateTime.parse(json['saveTime'] as String),
3535
mode: SimulationMode.values.singleWhere((mode) => mode.name == json['mode']),
36-
subteamCountryFlagPath: json['subteamCountryFlagPath'],
36+
subteamCountryFlagName: json['subteamCountryFlagPath'],
3737
);
3838
}
3939

40-
UserSimulationModel copyWith({
40+
SimulationModel copyWith({
4141
String? id,
4242
String? name,
4343
DateTime? saveTime,
4444
SimulationMode? mode,
4545
String? subteamCountryFlagPath,
4646
SimulationDatabase? database,
4747
}) {
48-
return UserSimulationModel(
48+
return SimulationModel(
4949
id: id ?? this.id,
5050
name: name ?? this.name,
5151
saveTime: saveTime ?? this.saveTime,
5252
mode: mode ?? this.mode,
53-
subteamCountryFlagPath: subteamCountryFlagPath ?? this.subteamCountryFlagPath,
53+
subteamCountryFlagName: subteamCountryFlagPath ?? this.subteamCountryFlagName,
5454
);
5555
}
5656
}

lib/data/models/simulation/user_simulation/user_simulations_registry_saver_to_file.dart renamed to lib/data/models/user_simulation/user_simulations_registry_saver_to_file.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:sj_manager/utilities/json/db_items_json.dart';
2-
import 'package:sj_manager/data/models/simulation/user_simulation/user_simulation_model.dart';
2+
import 'package:sj_manager/data/models/user_simulation/simulation_model.dart';
33
import 'package:sj_manager/utilities/utils/file_system.dart';
44
import 'package:path/path.dart' as path;
55

@@ -9,7 +9,7 @@ class UserSimulationsRegistrySaverToFile {
99
required this.pathsCache,
1010
});
1111

12-
final List<UserSimulationModel> userSimulations;
12+
final List<SimulationModel> userSimulations;
1313
final PlarformSpecificPathsCache pathsCache;
1414

1515
Future<void> serialize() async {

0 commit comments

Comments
 (0)