Example #1
0
 private void renderFigure(TurnResponse response) {
     var row = _table.rows[response.y].As<HtmlTableRowElement>();
     var cell = row.cells[response.x].As<HtmlTableCellElement>();
     if ((response.figure == EState.blue)) {
         js.addClass(cell, "tableCellX");
     }
     else {
         js.addClass(cell, "tableCell0");
     }
 }
Example #2
0
        public void onTurn(TurnResponse response) {
            JsString message = response.message;
            if (response.message == "") {
                renderFigure(response);

                _turnClientId = response.nextClientId;
                RefreshTurn();
            }
            else if (response.message == "turn again") {
            }
            else if (message.indexOf("winn") == 0) {
                js.addClass(_table, response.message);

                renderFigure(response);

                if (response.ClientId == ClientId) {
                    HtmlContext.window.alert("You winn");
                }
                else {
                    HtmlContext.window.alert("You loss");
                }

                var request = new ResetGameRequest();
                request.ClientId = ClientId;
                request.GameId = response.GameId;
                server.send(request);
            }
            else if (response.message == "equal") {
                renderFigure(response);

                HtmlContext.window.alert("equal");
            }
        }