Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move files to src and comply with the dart package layout convention #621

Merged
merged 3 commits into from
Jan 20, 2021

Conversation

renancaraujo
Copy link
Member

Description

This addresses #614.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • This branch is based on the latest master
  • I have added an entry under [next] in CHANGELOG.md
  • I have formatted my code with flutter format
  • I have made corresponding changes to the documentation
  • The continuous integration (CI) is passing

CHANGELOG.md Outdated
@@ -11,6 +11,7 @@
- Adding shortcut for loading Sprites and SpriteAnimation from the global cache
- Adding loading methods for the different `ParallaxComponent` parts and refactor how the delta velocity works
- Add tests for `Timer` and fix a bug where `progress` was not reported correctly
- move files to comply with the dart package layout convention
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would use structure instead of layout here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, Move

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is called layout: https://dart.dev/tools/pub/package-layout

lib/components.dart Show resolved Hide resolved
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, but this will definitely be a nice step forward!

export 'src/components/mixins/single_child_particle.dart';
export 'src/components/mixins/tapable.dart';

export 'src/extensions/vector2.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is here and also in extensions.dart, game.dart and effects.dart since it'll be almost impossible to use anything without Vector2?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make a fail extensions.dart on the extensions folder to export all our extensions? and then export that file everywhere instead of only vector2 ext

lib/joystick.dart Show resolved Hide resolved
@@ -1,6 +1,6 @@
import 'dart:ui';

import '../../particle.dart';
import '../../particles/particle.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this just import lib/particles.dart or is that not according to the standard?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It imports what needs to be imported, it doesn't need any of the particle implementations.

lib/src/widgets/sprite_button.dart Show resolved Hide resolved
test/vector2_test.dart Outdated Show resolved Hide resolved
@renancaraujo renancaraujo force-pushed the renan.file-organization branch from afbde62 to 368f5e1 Compare January 19, 2021 16:04
@renancaraujo renancaraujo marked this pull request as ready for review January 19, 2021 16:05
@renancaraujo renancaraujo force-pushed the renan.file-organization branch 4 times, most recently from 86f0f6c to d38e88c Compare January 19, 2021 16:12
Copy link
Member

@erickzanardo erickzanardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the linter problem is solved

@@ -1,6 +1,6 @@
import 'package:test/test.dart';

import 'package:flame/memory_cache.dart';
import 'package:flame/src/memory_cache.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this create a warning? (I hope not!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Member

@luanpotter luanpotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erickzanardo erickzanardo merged commit 00ad86e into master Jan 20, 2021
@erickzanardo erickzanardo deleted the renan.file-organization branch January 20, 2021 12:05
spydon added a commit that referenced this pull request Feb 24, 2021
* Update README to point at rc5 (#630)

* Update README to point at rc5

* Update README.md

* 👌 Throw exception from `parseAnchor` in `examples/widgets` instead of returning null (#632)

* Updated the widgets docs (#628)

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Removing initialDimensions and removeGesture methods (#627)

* Removing initialDimensions and removeGesture methods

* Removing wrongly commited folder

* PR suggestion

* Making SpriteComponent and SpriteAnimationComponent follow the same standard for empty constructors (#620)

* Added fallback support for the web on the `SpriteBatch` API (#612)

* Added fallback support for the web on the `SpriteBatch` API

* Refactored the SpriteBatch class

* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631)

* Move files to src and comply with the dart package layout convention (#621)

* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631)

* Move files to src and comply with the dart package layout convention

* Fixing widgets example

Co-authored-by: Serge Matveenko <lig@countzero.co>
Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>

* Fix gesture detection on children (#636)

* Fix gesture detection on children

* Remove unused imports

* positionParent should be private

* Fixed comment

* Moved parent to BaseComponent

* Fix formatting

* Initial implementation of the Composition class. (#634)

* Initial implementation of the Composition class

* Added decodeImageFromPixels web support

* Added a `required` to GameWidget and updated the docs (#638)

* Added a required to GameWidget and updated the docs

* Removed entry from CHANGELOG

* Release v1.0.0-rc6 (#639)

* Add hitbox to PositionComponent (#618)

* Move out collision detection methods

* Add possibility to define a hull for PositionComponents

* Add example of how to use hull with tapable

* Update contains point comment

* Fix contains point

* Hull should be based on center position

* Remove collision detection parts

* Added tests

* Use percentage of size instead of absolute size

* Separate hull from PositionComponent

* Clarify hull example

* Fix formatting

* Override correct method

* Use mixin for hitbox

* Update changelog

* Rename HasHitbox to Hitbox

* Clarified names

* Center to edge is considered as 1.0

* Fix test

* Add spaces within braces

* Removed extra spaces in the braces

* Add hitbox docs

* Fix link

* Moved point rotation to Vector2 extension

* Render hitbox within extension

* Fix rebase

* Fix rebase

* Fix formatting

* Removing Util.dart and moving its remaining parts to better places (#640)

* Removing Util.dart and moving its remaining parts to better places

* Fixing lint

* Doc fixes

* Doc fixes

* PR suggestions

* Adapting SpriteBatchComponent constructors to other components (#643)

* Adapting ParallaxComponent constructors to other components (#642)

* Adapating ParallaxComponent constructors to other components

* Removing wrongly commited folder

* Update doc/components.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Update doc/components.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Updating mds with recently 0.x patches

* 🏷 Null safety support

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants