コード例 #1
0
        private void Done_Click(object sender, RoutedEventArgs e)
        {
            if (WordInPlay.Count > 0)
            {
                List <Tuple <Core.Config.Coordinate, Core.Types.Tile> > tupleList =
                    new List <Tuple <Core.Config.Coordinate, Core.Types.Tile> >();

                foreach (KeyValuePair <Point, Tile> placed in WordInPlay)
                {
                    tupleList.Add(
                        new Tuple <Core.Config.Coordinate, Core.Types.Tile>(
                            new Core.Config.Coordinate((int)placed.Key.X, (int)placed.Key.Y),
                            new Core.Types.Tile(placed.Value.Letter[0])
                            )
                        );
                }

                Microsoft.FSharp.Collections.FSharpMap <Core.Config.Coordinate, Core.Types.Tile> map =
                    new Microsoft.FSharp.Collections.FSharpMap <Core.Config.Coordinate, Core.Types.Tile>(tupleList);

                PlaceMove pm = new PlaceMove(map);

                try
                {
                    CompleteTurn(pm);
                    //should probably reset everything

                    //WJS - need to clear out this collection
                    WordInPlay = new Dictionary <Point, Tile>();
                }
                catch (InvalidMoveException badmove)
                {
                    MessageBox.Show(badmove.Message);
                }
            }
            else
            {
                MessageBox.Show("You should probably try placing some letters first...");
            }
        }
コード例 #2
0
 /// <summary>
 /// Some other player, p, has placed some tiles on the board. Show them (or alternatively,
 /// just update the whole board object based on Game.Instance.PlayingBoard.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="p"></param>
 private void DrawOpponentTurn(PlaceMove t, Player p)
 {
     //redraw everything?
     RedrawBoard();
 }
コード例 #3
0
 /// <summary>
 /// Some other player, p, has placed some tiles on the board. Show them (or alternatively,
 /// just update the whole board object based on Game.Instance.PlayingBoard.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="p"></param>
 private void DrawOpponentTurn(PlaceMove t, Player p)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
        private void Done_Click(object sender, RoutedEventArgs e)
        {
            if (WordInPlay.Count > 0)
            {
                List<Tuple<Core.Config.Coordinate, Core.Types.Tile>> tupleList =
                    new List<Tuple<Core.Config.Coordinate, Core.Types.Tile>>();

                foreach (KeyValuePair<Point, Tile> placed in WordInPlay)
                {
                    tupleList.Add(
                        new Tuple<Core.Config.Coordinate, Core.Types.Tile>(
                            new Core.Config.Coordinate((int)placed.Key.X, (int)placed.Key.Y),
                            new Core.Types.Tile(placed.Value.Letter[0])
                            )
                            );
                }

                Microsoft.FSharp.Collections.FSharpMap<Core.Config.Coordinate, Core.Types.Tile> map = 
                    new Microsoft.FSharp.Collections.FSharpMap<Core.Config.Coordinate,Core.Types.Tile>(tupleList);

                PlaceMove pm = new PlaceMove(map);

                try
                {
                    CompleteTurn(pm);
                    //should probably reset everything

                    //WJS - need to clear out this collection
                    WordInPlay = new Dictionary<Point, Tile>();
                }
                catch (InvalidMoveException badmove)
                {
                    MessageBox.Show(badmove.Message);
                }
               
            }
            else
            {
                MessageBox.Show("You should probably try placing some letters first...");
            }
            
        }
コード例 #5
0
 /// <summary>
 /// Some other player, p, has placed some tiles on the board. Show them (or alternatively,
 /// just update the whole board object based on Game.Instance.PlayingBoard.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="p"></param>
 private void DrawOpponentTurn(PlaceMove t, Player p)
 {
     //redraw everything?
     RedrawBoard();
 }
コード例 #6
0
 /// <summary>
 /// Some other player, p, has placed some tiles on the board. Show them (or alternatively,
 /// just update the whole board object based on Game.Instance.PlayingBoard.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="p"></param>
 private void DrawOpponentTurn(PlaceMove t, Player p)
 {
     throw new NotImplementedException();
 }