0

ブラックジャック ゲームであるコンソール アプリを構築しようとしています。BlackJackTable : テーブルゲームで、6 つの BettingSpots があります。BettingSpots を含む配列が必要だと考えています。しかし、BettingSpot[] に入力しようとするとエラーが発生します。設計をより適切に進める方法についてのアドバイスをいただければ幸いです。

public abstract class TableGame
{
    // Can have 5-7 bettings spots.  Has a dealer, players, Rules
    public abstract void Rules();
    public abstract BettingSpot[] bettingSpotArray;
    public Dealer dealer = new Dealer();

}

public class BlackJackTable : TableGame
{

    // A blackjack tablegame "has a" 6 BettingSpots available that a Player chooses to occupy.  Have the Game ask the player which bettingspots they'd
    // like to place a bet on.  Bet amount must be the same for each.  Use a try catch block to make sure TotalChips >= all bets. 
    public BlackJackTable(int tableNumber)
    {
        _tableNumber = tableNumber;
    }

    public override void BlackJackRules()
    {  }

        BettingSpot spot1 = new BettingSpot(1);
        BettingSpot spot2 = new BettingSpot(2);
        BettingSpot spot3 = new BettingSpot(3);
        BettingSpot spot4 = new BettingSpot(4);
        BettingSpot spot5 = new BettingSpot(5);
        BettingSpot spot6 = new BettingSpot(6);

    public override BettingSpot[] bettingSpotArray = new BettingSpot[5];

    for (int i = 0; i < bettingSpotArray.Length; i++)
    {
        bettingSpotArray[i] = new BettingSpot[i+1];
    }

    public void QueryPlayerForBettingSpots(BettingSpot[] bettingSpotArray)
    {
        int[] BettingSpotsAvailable = new BettingSpot[5];
        for (int idx = 0; idx < 5; idx++)
            if (bettingSpotArray[idx] == 0)
                BettingSpotsAvailable[idx] 

        Console.WriteLine("Place up to 3 bets on the following available BettingSpots: {0}", bettingSpotArray.Where<BettingSpot.
    }

}

public class BettingSpot
{
    protected decimal bet = 0;
    public int _bettingSpotNumber;
    // How many spots are on the Blackjack table will determine how many seats there will be. There are six betting spots allowed, 
    // so six bettingspots are created. THere are just 6 BettingSpots available and a player can
    // occupy up to 3 BettingSpots at a time.  A bettingspot "has a" bet.  If no bet, put '0' in BettingSpotArray

    public BettingSpot(int number)
    {
        _bettingSpotNumber = number;
    }

    public Player player



    public decimal Bet
    {
        get
        {
            return bet;
        }
        set
        {
            bet = value;

    }

}
4

1 に答える 1