コード例 #1
0
        public void ReseveMoveTeam(ServiceReference1.Move m, string color)
        {
            //throw new NotImplementedException();
            Move move = new Move
            {
                MoveString   = m.MoveString,
                PlayerOfMove = m.PlayerOfMove,
                GameOfMove   = game
            };

            move.PlayerOfMove.Color = color;

            makeMove(move);
            AllMoves.Add(move);
            EndTurn();
        }
コード例 #2
0
        private void SendMove(Move move)
        {
            InstanceContext context = new InstanceContext(this);

            proxy = new Service2Client(context);
            string sendingTo = null;

            if (!isTeamGame)
            {
                if (CurrentPlayre == game.Player1)
                {
                    sendingTo = creatPlayerString(game.Player2);
                }
                else
                {
                    sendingTo = creatPlayerString(game.Player1);
                }
                string FullMoveString = sendingTo + "&" + move.MoveString + "&" + move.PlayerOfMove.Color;
                proxy.sendMove(FullMoveString);
            }
            else
            {
                ServiceReference1.Move m = new ServiceReference1.Move
                {
                    MoveId       = move.MoveId,
                    GameOfMove   = move.GameOfMove,
                    PlayerOfMove = move.PlayerOfMove,
                    MoveString   = move.MoveString
                };
                if (CurrentTeam.id == game.Team1.id)
                {
                    proxy.sendMoveTeam(game.Team2, m, move.PlayerOfMove.Color);
                }
                else
                {
                    proxy.sendMoveTeam(game.Team1, m, move.PlayerOfMove.Color);
                }
            }
        }
コード例 #3
0
 public void ReseveMoveTeam(ServiceReference1.Move m, string color)
 {
     // throw new NotImplementedException();
     window.ReseveMoveTeam(m, color);
 }