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

Side by Side Diff: samples/dartcombat/setup.dart

Issue 11418075: Dartifying members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixing menuelement.compact exclusion. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/chat/js_client/code.js ('k') | samples/dartcombat/views.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** Entrypoint to set up the dartcombat sample. */ 5 /** Entrypoint to set up the dartcombat sample. */
6 void setUpGame() { 6 void setUpGame() {
7 setupUI(); 7 setupUI();
8 createPlayers(); 8 createPlayers();
9 } 9 }
10 10
11 /** Sets up the UI creating the board for each player. */ 11 /** Sets up the UI creating the board for each player. */
12 void setupUI() { 12 void setupUI() {
13 // Note: we set up the UI programatically to make testing easier. 13 // Note: we set up the UI programatically to make testing easier.
14 var div = new Element.tag("div"); 14 var div = new Element.tag("div");
15 div.innerHTML = """ 15 div.innerHtml = """
16 <div class='hbox'> 16 <div class='hbox'>
17 <div class='vbox'> 17 <div class='vbox'>
18 Player 1 board: 18 Player 1 board:
19 <div class='own' id='p1own'></div> 19 <div class='own' id='p1own'></div>
20 Known of enemy's board: 20 Known of enemy's board:
21 <div class='enemy' id='p1enemy'></div> 21 <div class='enemy' id='p1enemy'></div>
22 </div> 22 </div>
23 <div style='width:20%'></div> 23 <div style='width:20%'></div>
24 <div class='vbox'> 24 <div class='vbox'>
25 Player 2 board: 25 Player 2 board:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 _target.send(message, reply); 85 _target.send(message, reply);
86 } 86 }
87 }, 200); 87 }, 200);
88 }); 88 });
89 } 89 }
90 90
91 // TODO(sigmund): introduce UI to control flakiness, then do: 91 // TODO(sigmund): introduce UI to control flakiness, then do:
92 // => Math.random() > 0.9; 92 // => Math.random() > 0.9;
93 bool randomlyFail() => false; 93 bool randomlyFail() => false;
94 } 94 }
OLDNEW
« no previous file with comments | « samples/chat/js_client/code.js ('k') | samples/dartcombat/views.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698