private bool HaveTile(PlayerData p, Tile.Family f, int pos) { Group g = p.GetHand(); for (int i = 0; i < g.Count; i++) { if ((g[i].GetFamily() == f) && (g[i].GetNumber() == pos)) return true; } return false; }
private Tile GetTile(PlayerData p, Tile.Family f, int pos) { Group g = p.GetHand(); for (int i = 0; i < g.Count; i++) { if ((g[i].GetFamily() == f) && (g[i].GetNumber() == pos)) return g[i]; } return null; }
public bool AddRejected(Tile add) { m_rejected = add; return true; }
public void Reset() { m_hand = new Group(); m_cemetery = new Group(); m_exposed = new Group(); m_rejected = null; }
public bool AddExposed(Tile add) { m_exposed.Add(add); return true; }
public bool AddHand(Tile add) { m_hand.Add(add); return true; }
public bool AddCemetery(Tile add) { m_cemetery.Add(add); return true; }
protected TilePosition GetTilePosition(Tile t) { for (int i = 0; i < m_tiles.Count; i++) if (m_tiles[i].Tile == t) return m_tiles[i].Position; return TilePosition.Cemetery; }
protected bool ChangeTileStatus(Tile t, TilePosition tp) { for (int i = 0; i < m_tiles.Count; i++) { if (m_tiles[i].Tile == t) { m_stile tmp = m_tiles[i]; tmp.Position = tp; m_tiles[i] = tmp; return true; } } return false; }
public bool Rejected(PlayerData p, Tile t) { if (p != m_current) return false; if (m_mutextaken == false) return false; m_mutextaken = false; m_current.GetHand().Remove(t); GetPreviousPlayer().AddRejected(null); m_current.AddRejected(t); ChangeTileStatus(t, TilePosition.Rejected); m_current = GetNextPlayer(); return true; }
public bool RemoveHand(Tile del) { return m_hand.Remove(del); }