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..."); } }
/// <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(); }
/// <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(); }
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..."); } }