| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** A local player (API known to the main isolate when creating players). */ | 5 /** A local player (API known to the main isolate when creating players). */ |
| 6 interface Player factory PlayerImpl { | 6 interface Player default PlayerImpl { |
| 7 | 7 |
| 8 Player(); | 8 Player(); |
| 9 | 9 |
| 10 final Future<SendPort> portToPlayer; | 10 final Future<SendPort> portToPlayer; |
| 11 | 11 |
| 12 void setup(Window window, int player); | 12 void setup(Window window, int player); |
| 13 | 13 |
| 14 void set enemy(SendPort portToEnemy); | 14 void set enemy(SendPort portToEnemy); |
| 15 | 15 |
| 16 void set _portForTest(SendPort testPort); | 16 void set _portForTest(SendPort testPort); |
| 17 } | 17 } |
| 18 | 18 |
| 19 /** A remote enemy (API visible to a player to communicate with the enemy). */ | 19 /** A remote enemy (API visible to a player to communicate with the enemy). */ |
| 20 interface Enemy factory EnemyImpl { | 20 interface Enemy default EnemyImpl { |
| 21 Enemy(SendPort port); | 21 Enemy(SendPort port); |
| 22 | 22 |
| 23 /** tell the enemy that we are ready, receive confirmation asynchronously. */ | 23 /** tell the enemy that we are ready, receive confirmation asynchronously. */ |
| 24 Future<int> ready(); | 24 Future<int> ready(); |
| 25 | 25 |
| 26 /** shoot asynchronously. */ | 26 /** shoot asynchronously. */ |
| 27 Future<int> shoot(int x, int y); | 27 Future<int> shoot(int x, int y); |
| 28 } | 28 } |
| 29 | 29 |
| 30 | 30 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 /** message indicating that the enemy is ready to play. */ | 107 /** message indicating that the enemy is ready to play. */ |
| 108 static final ENEMY_IS_READY = 3; | 108 static final ENEMY_IS_READY = 3; |
| 109 | 109 |
| 110 /** message describing a shoot action. */ | 110 /** message describing a shoot action. */ |
| 111 static final SHOOT = 4; | 111 static final SHOOT = 4; |
| 112 | 112 |
| 113 /** message to set up a test port, used to make tests non-flaky. */ | 113 /** message to set up a test port, used to make tests non-flaky. */ |
| 114 static final SET_PORT_FOR_TEST = 5; | 114 static final SET_PORT_FOR_TEST = 5; |
| 115 } | 115 } |
| OLD | NEW |