//*********************************************************************** //******************************** Setup ******************************** //*********************************************************************** //Builds the wall for a new game public void Build(UnsortedTileCollection tiles, int accessKey = 0) { if ((accessKey != _accessKey) && _accessKey != 0) { return; } //Reset status conditions doras.Clear(); kanReplacementDraws = 0; numberOfRegularDoras = 0; //Reset tiles and wall Tiles = tiles; Tiles.SetOwner(_accessKey); for (int i = 0; i < Tiles.Count; i++) { Tiles[i].SetOwner(_accessKey); Tiles[i].SetVisibility(TileVisibility.FaceDown, _accessKey); } //Shuffle ShuffleRange(0, Tiles.Count - 1); //Arrange wall ArrangeWall(); //Done EventManager.FlagEvent("Wall Built"); }
//Builds a wall while forcing the first N draws and dora/kandora. For testing only. public void Build_ForceOrder(UnsortedTileCollection tiles, List <TileID> firstDraws, List <TileID> firstDoras, int accessKey = 0) { if ((accessKey != _accessKey) && _accessKey != 0) { return; } //Reset status conditions doras.Clear(); kanReplacementDraws = 0; numberOfRegularDoras = 0; //Reset tiles and wall Tiles = tiles; Tiles.SetOwner(_accessKey); for (int i = 0; i < Tiles.Count; i++) { Tiles[i].SetOwner(_accessKey); Tiles[i].SetVisibility(TileVisibility.FaceDown, _accessKey); } //Set first draws for (int i = 0; i < firstDraws.Count; i++) { ForceTileAt(firstDraws[i], i, i + 1, Tiles.Count - 1); } //Set first doras for (int i = 0; i < firstDoras.Count; i++) { ForceTileAt(firstDoras[i], Tiles.Count - 1 - i, firstDraws.Count, Tiles.Count - 1 - i - 1); } //Shuffle ShuffleRange(firstDraws.Count, Tiles.Count - 1 - firstDoras.Count); //Done EventManager.FlagEvent("Wall Built"); }