//Adds a tile to the hand but resets to no owner and sets to face up public void AddNaki(Tile tile) { AddTile(tile); //Note: sets owner Draw = tile; tile.ReleaseOwnership(_accessKey); //Resets to no owner tile.SetVisibility(TileVisibility.FaceUp); }
//Flips a new dora. public TileID NewDora() { Tile indicator = Tiles[Tiles.Count - numberOfRegularDoras * 2 - 2]; indicator.ReleaseOwnership(_accessKey); indicator.SetVisibility(TileVisibility.FaceUp); doras.Add(indicator.Query().GetDoraFromIndicator()); numberOfRegularDoras++; EventManager.FlagEvent("New Dora"); return(doras[doras.Count - 1]); }
//*********************************************************************** //******************************* Gameplay ****************************** //*********************************************************************** //Draws a single tile from the wall public Tile Draw() { if (NumberDrawsRemaining == 0) { return(null); } Tile tile = Tiles[0]; Tiles.RemoveAt(0); tile.ReleaseOwnership(_accessKey); return(tile); }
//Removes the first occurring matching tile from the hand and sets it as a recent discard public void RemoveDiscard(Tile tile, Kawa kawa, int accessKey = 0) { if (accessKey != _accessKey && _accessKey != 0) { return; } Tiles.Remove(tile, _accessKey); Discard = tile; tile.ReleaseOwnership(_accessKey); tile.StolenFrom = PlayerNumber; kawa.Add(Discard); //TODO: revisit when kawa is refactored to use Tile instead of GameObject EventManager.FlagEvent("Hand " + PlayerNumber + " Discard"); }