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

Unified Diff: 2-1-starter/lib/common/utils.dart

Issue 1056193003: Rename methods to better match new terminology and get rid of json data file. (Closed) Base URL: https://github.com/dart-lang/one-hour-codelab.git@server2
Patch Set: Created 5 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 | « 2-1-starter/lib/common/messages.dart ('k') | 2-1-starter/lib/server/piratenames.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 2-1-starter/lib/common/utils.dart
diff --git a/2-1-starter/lib/common/utils.dart b/2-1-starter/lib/common/utils.dart
index 32a0a4639c19fda6c7f5af29753b87fad4e4c941..e9543875c533a01e89366f6aa056ce42f61670cf 100644
--- a/2-1-starter/lib/common/utils.dart
+++ b/2-1-starter/lib/common/utils.dart
@@ -8,7 +8,35 @@ import 'dart:math' show Random;
import 'messages.dart';
-List<String> _forbiddenAppellations = [
+// Proper pirate names and appellations.
+const Map<String, List<String>> properPirateNames = const {
+"names": const [ "Anne", "Bette", "Cate", "Dawn",
+ "Elise", "Faye", "Ginger", "Harriot",
+ "Izzy", "Jane", "Kaye", "Liz",
+ "Maria", "Nell", "Olive", "Pat",
+ "Queenie", "Rae", "Sal", "Tam",
+ "Uma", "Violet", "Wilma", "Xana",
+ "Yvonne", "Zelda",
+ "Abe", "Billy", "Caleb", "Davie",
+ "Eb", "Frank", "Gabe", "House",
+ "Icarus", "Jack", "Kurt", "Larry",
+ "Mike", "Nolan", "Oliver", "Pat",
+ "Quib", "Roy", "Sal", "Tom",
+ "Ube", "Val", "Walt", "Xavier",
+ "Yvan", "Zeb"],
+"appellations": const [ "Awesome", "Captain",
+ "Even", "Fighter", "Great", "Hearty",
+ "Jackal", "King", "Lord",
+ "Mighty", "Noble", "Old", "Powerful",
+ "Quick", "Red", "Stalwart", "Tank",
+ "Ultimate", "Vicious", "Wily", "aXe", "Young",
+ "Brave", "Eager",
+ "Kind", "Sandy",
+ "Xeric", "Yellow", "Zesty"]
+};
+
+// Clearly invalid pirate appellations.
+const List<String> _forbiddenAppellations = const [
null,
'',
'sweet',
« no previous file with comments | « 2-1-starter/lib/common/messages.dart ('k') | 2-1-starter/lib/server/piratenames.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698