コード例 #1
0
ファイル: Game.cs プロジェクト: tmoritaa/Ponjan
    // TODO: later make it based on discarded tiles. For now, let AI cheat and get exact probabilities.
    public TileDrawProb GetProbOfDrawingTile(Tile.TileProp tileProp, int num)
    {
        List <Tile> tiles = this.deck.Tiles.FindAll(t => tileProp.Equals(t));

        float prob = 1;

        for (int i = 0; i < num; ++i)
        {
            prob *= (float)(tiles.Count - i) / (float)(this.deck.Tiles.Count - i);
        }

        return(new TileDrawProb(tileProp, prob));
    }
コード例 #2
0
 public TileDrawProb(Tile.TileProp prop, float prob)
 {
     this.tileProp = prop;
     this.prob     = prob;
 }