Exemplo n.º 1
0
 internal DiscardInformation(XElement message)
 {
     Callable = message.Attributes("t").Any();
       var name = message.Name.LocalName;
       Tsumokiri = "defg".Contains(name[0]);
       PlayerIndex = name[0] - (Tsumokiri ? 'd' : 'D');
       Tile = new Tile(InvariantConvert.ToInt32(name.Substring(1)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Calls a chii on the last discard with two other tiles.
 /// </summary>
 /// <param name="tile0">A tile from the caller's hand to add to the chii.</param>
 /// <param name="tile1">A tile from the caller's hand to add to the chii.</param>
 public void CallChii(Tile tile0, Tile tile1)
 {
     Validate.NotNull(tile0, "tile0");
       Validate.NotNull(tile1, "tile1");
       var type = new XAttribute("type", "3");
       var hai0 = new XAttribute("hai0", tile0.Id);
       var hai1 = new XAttribute("hai1", tile1.Id);
       _connection.Send(new XElement("N", type, hai0, hai1));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Tells the client that the active player drew a tile.
 /// </summary>
 /// <param name="tile">The tile that was drawn.</param>
 public void DrawTile(Tile tile)
 {
     AddMessageOnGuiThread("Tile drawn");
 }
Exemplo n.º 4
0
 /// <summary>
 /// Tells the client that the active player drew a tile.
 /// </summary>
 /// <param name="tile">The tile that was drawn.</param>
 public void DrawTile(Tile tile)
 {
     _hand.Add(tile);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Tells the client that the active player drew a tile.
 /// </summary>
 /// <param name="tile">The tile that was drawn.</param>
 public void DrawTile(Tile tile)
 {
     _sender.Discard(tile);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Discards a tile.
 /// </summary>
 /// <param name="tile">The tile to discard.</param>
 public void Discard(Tile tile)
 {
     Validate.NotNull(tile, "tile");
       _connection.Send(new XElement("D", new XAttribute("p", tile.Id)));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Determines if the tile has been called, added to a koutsu or selected from the meld owner's hand.
 /// </summary>
 private MeldTileType GetMeldTileType(Tile tile)
 {
     if (Type != MeldType.ClosedKan && tile == GetCalledTile())
       {
     return MeldTileType.Called;
       }
       if (Type == MeldType.AddedKan && tile == GetAddedTile())
       {
     return MeldTileType.Added;
       }
       return MeldTileType.Normal;
 }