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

Unified Diff: samples/pop_pop_win/lib/src/audio.dart

Issue 786443002: Delete pop-pop-win from the repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/pop_pop_win.dart ('k') | samples/pop_pop_win/lib/src/game.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/audio.dart
diff --git a/samples/pop_pop_win/lib/src/audio.dart b/samples/pop_pop_win/lib/src/audio.dart
deleted file mode 100644
index 8c52e1b0d876590014c6245efd286baaf63e535d..0000000000000000000000000000000000000000
--- a/samples/pop_pop_win/lib/src/audio.dart
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-library pop_pop_win.audio;
-
-import 'dart:math';
-
-import 'package:stagexl/stagexl.dart';
-
-class GameAudio {
- static final Random _rnd = new Random();
-
- static ResourceManager _resourceManager;
-
- static const String _WIN = 'win',
- _CLICK = 'click',
- _POP = 'Pop',
- _FLAG = 'flag',
- _UNFLAG = 'unflag',
- _BOMB = 'Bomb',
- _THROW_DART = 'throw';
-
- static void initialize(ResourceManager resourceManager) {
- if (_resourceManager != null) throw new StateError('already initialized');
- _resourceManager = resourceManager;
- }
-
- static void win() => _playAudio(_WIN);
-
- static void click() => _playAudio(_CLICK);
-
- static void pop() => _playAudio(_POP);
-
- static void flag() => _playAudio(_FLAG);
-
- static void unflag() => _playAudio(_UNFLAG);
-
- static void bomb() => _playAudio(_BOMB);
-
- static void throwDart() => _playAudio(_THROW_DART);
-
- static void _playAudio(String name) {
- if (_resourceManager == null) throw new StateError('Not initialized');
- switch (name) {
- case GameAudio._POP:
- var i = _rnd.nextInt(8);
- name = '${GameAudio._POP}$i';
- break;
- case GameAudio._BOMB:
- var i = _rnd.nextInt(4);
- name = '${GameAudio._BOMB}$i';
- break;
- }
- _resourceManager.getSoundSprite('audio').play(name);
- }
-}
« no previous file with comments | « samples/pop_pop_win/lib/pop_pop_win.dart ('k') | samples/pop_pop_win/lib/src/game.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698