Ejemplo n.º 1
0
 public void StartNewRound()
 {
     currentAgentIndex = 0;
     targetCard = null;
     agents = new List<Agent>();
     // If you want to add a human player, change the code below...
     for (int i = 0; i < 3; i++) {
         agents.Add(new Agent_AI(i, this));
     }
     agents.Add(new Agent_Human(3, this));
     deck = GetShuffledDeck();
     // For each agent pick 13 cards from the deck and remove them from the deck
     for (int i = 0; i < agents.Count; i++) {
         for (int j = 0; j < 13; j++) {
             agents[i].cards.Add(deck[0]);
             deck.RemoveAt(0);
         }
         if (agents[i].isDealer) {
             agents[i].cards.Add(deck[0]);
             deck.RemoveAt(0);
         }
     }
     //foreach (Agent a in agents) {
     //    a.holdingCards.Sort();
     //}
     NextStep();
 }
 public override void AskForPeng(Card targetCard)
 {
     manager.AskForPengCallback(null, this.agentIndex);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 不可传入空值,表示Agent打某张牌
 /// </summary>
 public void AskForPlayCallback(Card playCard, int agentIndex)
 {
     currentState = ManagerState.ASK_DIAN_PAO;
     targetCard = playCard;
     agents[currentAgentIndex].cards.Remove(playCard);
     //agents[currentAgentIndex].playedCards.Add(playCard);
     agents[currentAgentIndex].cards.Sort();
     currentAgentIndex = GetNextIndex(agentIndex);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 询问是否碰,如果碰给出一个非空集合
 /// 如果给出Count==3的集合,表示杠
 /// 否则给出空集合
 /// </summary>
 public virtual void AskForPeng(Card targetCard)
 {
 }
 public override void AskForHu(Card targetCard)
 {
     manager.AskForDianPaoCallback(false, this.agentIndex);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 询问是否胡别人打出的这一张
 /// </summary>
 public virtual void AskForHu(Card targetCard)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 询问是否吃,如果吃则给出一个非空集合,
 /// 否则给出空集合
 /// </summary>
 public virtual void AskForChi(Card targetCard)
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 让Agent抓一张牌。这张牌会添加到手牌中
 /// </summary>
 public void PickCard(Card c)
 {
     this.cards.Add(c);
 }
 public override void AskForPeng(Card targetCard)
 {
 }
 public override void AskForHu(Card targetCard)
 {
 }