Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: samples/pop_pop_win/lib/src/canvas/board_element.dart

Issue 242443008: samples/pop_pop_win: now based on StageXL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tiny nit Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/pop_pop_win/lib/src/canvas.dart ('k') | samples/pop_pop_win/lib/src/canvas/game_audio.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/pop_pop_win/lib/src/canvas/board_element.dart
diff --git a/samples/pop_pop_win/lib/src/canvas/board_element.dart b/samples/pop_pop_win/lib/src/canvas/board_element.dart
deleted file mode 100644
index 10969624d3642d0e13c04d97ef73a486dc19a3d1..0000000000000000000000000000000000000000
--- a/samples/pop_pop_win/lib/src/canvas/board_element.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-part of pop_pop_win.canvas;
-
-class BoardElement extends ParentThing {
- Array2d<SquareElement> _elements;
-
- BoardElement(): super(0, 0) {
- cacheEnabled = true;
- }
-
- int get visualChildCount {
- if (_elements == null) {
- return 0;
- } else {
- return _elements.length;
- }
- }
-
- Thing getVisualChild(int index) {
- return _elements[index];
- }
-
- void update() {
- if (_game == null) {
- _elements = null;
- } else if(_elementsNeedUpdate) {
- _elements = new Array2d<SquareElement>(
- _game.field.width, _game.field.height);
-
- for (int i = 0; i < _elements.length; i++) {
- final coords = _elements.getCoordinate(i);
- final se = new SquareElement(coords.item1, coords.item2);
- se.registerParent(this);
-
- _gameElement.wireSquareMouseEvent(se);
-
- // position the square
- final etx = se.addTransform();
- etx.setToTranslation(coords.item1 * SquareElement._size,
- coords.item2 * SquareElement._size);
-
- _elements[i] = se;
- }
-
- size = new Size(_game.field.width * SquareElement._size,
- _game.field.height * SquareElement._size);
- }
- super.update();
- }
-
- GameElement get _gameElement => (parent as CanvasThing).parent;
-
- Game get _game => _gameElement._game;
-
- bool get _elementsNeedUpdate {
- assert(_game != null);
- return _elements == null ||
- _elements.width != _game.field.width ||
- _elements.height != _game.field.height;
- }
-
- TextureData get _textureData => _gameElement._textureData;
-
-}
« no previous file with comments | « samples/pop_pop_win/lib/src/canvas.dart ('k') | samples/pop_pop_win/lib/src/canvas/game_audio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698