Merge "Adding mutexes to avoid crashes Adding shelf for play view take trick"
diff --git a/go/.gitignore b/go/.gitignore
new file mode 100644
index 0000000..de48797
--- /dev/null
+++ b/go/.gitignore
@@ -0,0 +1,2 @@
+credentials/
+tmp/syncbase/
diff --git a/go/Makefile b/go/Makefile
index 8e58388..b40eb73 100644
--- a/go/Makefile
+++ b/go/Makefile
@@ -5,9 +5,7 @@
 PATH := ./bin/:$(PATH)
 go_files := $(shell find ./src -name "*.go")
 
-.PHONY:
-start: all
-	st --port $(port) --host $(host) --dir public --no-cache --index index.html
+export GOPATH := $(JIRI_ROOT)/release/projects/croupier/go:$(GOPATH)
 
 bin/principal:
 	jiri go build -a -o $@ v.io/x/ref/cmd/principal
@@ -38,17 +36,47 @@
 		--v23.credentials=credentials \
 		--v23.permissions.literal='{"Admin":{"In":["..."]},"Write":{"In":["..."]},"Read":{"In":["..."]},"Resolve":{"In":["..."]},"Debug":{"In":["..."]}}'
 
-test:
+test: src/golang.org/x/mobile/cmd/gomobile vet
 	jiri go test hearts/...
 
-fmt:
+fmt: src/golang.org/x/mobile/cmd/gomobile
 	jiri go fmt hearts/...
 
-vet:
+vet: src/golang.org/x/mobile/cmd/gomobile
 	jiri go vet hearts/...
 
-all: fmt 
+# This project depends on gomobile, which is retrieved by `go get`.
+# Note: Since this Makefile prepends "./go" to the GOPATH, gomobile will be
+# installed in go/src/golang.org, which makes it easier to delete.
+src/golang.org/x/mobile/cmd/gomobile:
+	go get golang.org/x/mobile/cmd/gomobile
+
+# Builds the Hearts binary.
+bin/hearts: $(go_files) src/golang.org/x/mobile/cmd/gomobile | fmt
+	jiri go build -o $@ hearts
+
+# gomobile resolves assets through the working directory.
+# This symlink points ./assets to the assets in ./src/hearts/assets.
+assets:
+	ln -sf src/hearts/assets assets
+
+.PHONY: hearts
+hearts: bin/hearts assets credentials
+	bin/hearts \
+	--v23.tcp.address=:$(syncbase_port) \
+	--v23.credentials=credentials
+
+.PHONY: clean
+clean:
+	rm -f assets
+	rm -rf bin
+	rm -rf credentials
+	rm -rf pkg
+	rm -rf src/golang.org/x/mobile/cmd/gomobile
+	rm -rf tmp/syncbase
+
+all: bin/hearts
 
 # Switch mountpoints by replacing the --name flag in syncbase with the following line:
-# 
-#--name=/192.168.86.254:8101/croupier/$(name) \
\ No newline at end of file
+#
+#--name=/192.168.86.254:8101/croupier/$(name) \
diff --git a/go/src/hearts/assets/android.png b/go/src/hearts/assets/android.png
new file mode 100644
index 0000000..bbbdeef
--- /dev/null
+++ b/go/src/hearts/assets/android.png
Binary files differ
diff --git a/go/src/hearts/assets/cat.png b/go/src/hearts/assets/cat.png
new file mode 100644
index 0000000..a07786f
--- /dev/null
+++ b/go/src/hearts/assets/cat.png
Binary files differ
diff --git a/go/src/hearts/assets/man.png b/go/src/hearts/assets/man.png
new file mode 100644
index 0000000..1cc56d4
--- /dev/null
+++ b/go/src/hearts/assets/man.png
Binary files differ
diff --git a/go/src/hearts/assets/woman.png b/go/src/hearts/assets/woman.png
new file mode 100644
index 0000000..38817cb
--- /dev/null
+++ b/go/src/hearts/assets/woman.png
Binary files differ
diff --git a/go/src/hearts/img/texture/texture.go b/go/src/hearts/img/texture/texture.go
index 6b6cd08..2ffc183 100644
--- a/go/src/hearts/img/texture/texture.go
+++ b/go/src/hearts/img/texture/texture.go
@@ -277,7 +277,7 @@
 		"StartBluePressed.png", "Restart.png", "Visibility.png", "VisibilityOff.png", "QuitPressed.png", "QuitUnpressed.png",
 		"PassPressed.png", "PassUnpressed.png", "RightArrowBlue.png", "LeftArrowBlue.png", "AcrossArrowBlue.png", "RightArrowGray.png",
 		"LeftArrowGray.png", "AcrossArrowGray.png", "TakeTrickTableUnpressed.png", "TakeTrickTablePressed.png", "TakeTrickHandPressed.png",
-		"TakeTrickHandUnpressed.png",
+		"TakeTrickHandUnpressed.png", "android.png", "cat.png", "man.png", "woman.png",
 	}
 	for _, f := range boundedImgs {
 		a, err := asset.Open(f)
diff --git a/go/src/hearts/logic/table/table.go b/go/src/hearts/logic/table/table.go
index 506a054..f20e905 100644
--- a/go/src/hearts/logic/table/table.go
+++ b/go/src/hearts/logic/table/table.go
@@ -180,7 +180,6 @@
 			return "Must follow suit"
 		}
 	}
-	return "Invalid play"
 }
 
 // Returns true if all players have their initial dealt hands
diff --git a/go/src/hearts/sync/util.go b/go/src/hearts/sync/util.go
index 7ee4d6d..2f8d8fc 100644
--- a/go/src/hearts/sync/util.go
+++ b/go/src/hearts/sync/util.go
@@ -8,11 +8,11 @@
 
 const (
 	// switch back to my mountpoint with the following code:
-	MountPoint = "users/emshack@google.com"
-	//MountPoint        = "/192.168.86.254:8101"
+	//MountPoint = "users/emshack@google.com"
+	MountPoint        = "/192.168.86.254:8101"
 	UserID            = 2222
 	UserColor         = 16777215
-	UserAvatar        = "player1.jpeg"
+	UserAvatar        = "man.png"
 	UserName          = "Bob"
 	SBName            = "syncbase1"
 	AppName           = "app"
diff --git a/images/avatars/android.png b/images/avatars/android.png
new file mode 100644
index 0000000..e8568e6
--- /dev/null
+++ b/images/avatars/android.png
Binary files differ
diff --git a/images/avatars/cat.png b/images/avatars/cat.png
new file mode 100644
index 0000000..de1487a
--- /dev/null
+++ b/images/avatars/cat.png
Binary files differ
diff --git a/images/avatars/man.png b/images/avatars/man.png
new file mode 100644
index 0000000..f470233
--- /dev/null
+++ b/images/avatars/man.png
Binary files differ
diff --git a/images/avatars/woman.png b/images/avatars/woman.png
new file mode 100644
index 0000000..77515d5
--- /dev/null
+++ b/images/avatars/woman.png
Binary files differ
diff --git a/lib/logic/croupier_settings.dart b/lib/logic/croupier_settings.dart
index c83f3c9..69823a4 100644
--- a/lib/logic/croupier_settings.dart
+++ b/lib/logic/croupier_settings.dart
@@ -95,10 +95,10 @@
     'Diamond.png',
     'Heart.png',
     'Spade.png',
-    'player0.jpeg',
-    'player1.jpeg',
-    'player2.jpeg',
-    'player3.jpeg',
+    'cat.png',
+    'android.png',
+    'man.png',
+    'woman.png',
   ];
   static final List names = [
     'Anne',
diff --git a/manifest.yaml b/manifest.yaml
index 6fbe3fb..67dd5b0 100644
--- a/manifest.yaml
+++ b/manifest.yaml
@@ -232,6 +232,10 @@
   - images/avatars/player1.jpeg
   - images/avatars/player2.jpeg
   - images/avatars/player3.jpeg
+  - images/avatars/cat.png
+  - images/avatars/android.png
+  - images/avatars/man.png
+  - images/avatars/woman.png
   - images/splash/background.png
   - images/splash/flutter.png
   - images/splash/vanadium.png
diff --git a/pubspec.lock b/pubspec.lock
index 4360dd9..0d9d601 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -174,15 +174,15 @@
   shelf:
     description: shelf
     source: hosted
-    version: "0.6.4+2"
+    version: "0.6.4+3"
   shelf_static:
     description: shelf_static
     source: hosted
-    version: "0.2.3+1"
+    version: "0.2.3+2"
   shelf_web_socket:
     description: shelf_web_socket
     source: hosted
-    version: "0.0.1+4"
+    version: "0.0.1+5"
   sky_engine:
     description: sky_engine
     source: hosted
diff --git a/shortcut_template b/shortcut_template
index 5cd8e15..5df960b 100644
--- a/shortcut_template
+++ b/shortcut_template
@@ -1,4 +1,4 @@
---map-origin=http://flutter/=https://storage.googleapis.com/mojo/flutter/9f112cbeced8e92b929905b8f40b0f89bcc26f1e/android-arm/
+--map-origin=http://flutter/=https://storage.googleapis.com/mojo/flutter/e5c866cd9573c4a8fe893ddcf196be5aaef4df38/android-arm/
 --url-mappings=mojo:flutter=http://flutter/flutter.mojo
 --debug
 --verbose