Ejemplo n.º 1
0
 private void ReceivedGameImage(GameImage gameImage)
 {
     if (!Guard.IsNullOrEmpty(gameImage.ID))
     {
         MessageBox.Show(GameImageSavesMessage);
     }
 }
Ejemplo n.º 2
0
        public void CreateGameImage(GameImage gameImage)
        {
            var content = new SocketAction
            {
                Route   = "gameImage.post.create",
                Payload = new {
                    hints        = gameImage.Hints,
                    word         = gameImage.Word,
                    lang         = gameImage.WordLanguage,
                    difficulty   = gameImage.Difficulty,
                    canvas       = gameImage.Canvas,
                    drawing_mode = gameImage.DrawingMode
                }
            };

            Emit(ActionRoute, content);
        }
Ejemplo n.º 3
0
        private void SaveGameImage(object obj)
        {
            if (!CanSaveGameImage())
            {
                return;
            }

            SetDrawingMode();

            var gameImage = new GameImage();

            gameImage.Hints        = new List <string>(Hints);
            gameImage.Word         = CurrentWord;
            gameImage.Difficulty   = _gameDifficulty;
            gameImage.DrawingMode  = _drawingMode;
            gameImage.WordLanguage = _wordLanguage;
            gameImage.Canvas       = new Canvas()
            {
                ID      = DrawingServiceSingleton.Instance.DrawingService.ListOfStrokes[0].CanvasID,
                Strokes = DrawingServiceSingleton.Instance.DrawingService.ListOfStrokes,
                UserIds = new List <string>()
            };
            WebSocket.Instance.CreateGameImage(gameImage);
        }