Esempio n. 1
0
 public HandObject(Hand hand, bool topHand, int cardHeight, int cardWidth, CardDatabase cardsDB)
 {
     _hand = hand;
     _cardHeight = cardHeight;
     _cardWidth = cardWidth;
     _topHand = topHand;
     _cardsDB = cardsDB;
 }
Esempio n. 2
0
 public State(IPlayer player1, IPlayer player2, Hand hand1, Hand hand2)
 {
     GameOver = false;
     ActivePlayer = player1;
     OtherPlayer = player2;
     ActiveHand = hand1;
     OtherHand = hand2;
 }
Esempio n. 3
0
        public void EndTurn()
        {
            // Switch active player
            var temp = ActivePlayer;
            ActivePlayer = OtherPlayer;
            OtherPlayer = temp;

            // Switch active hand
            var temp2 = ActiveHand;
            ActiveHand = OtherHand;
            OtherHand = temp2;
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var humanHand = new Hand(true);
            var compHand1 = new Hand(true);
            //var compHand2 = new Hand();

            var human = new HumanPlayer("Gary", humanHand);
            var comp1 = new ComputerPlayer("Bob", compHand1);
            //var comp2 = new ComputerPlayer("Jane", compHand2);

            //var state = new State(comp1, comp2, compHand1, compHand2);
            var state = new State(human, comp1, humanHand, compHand1);

            GameManager.Play(state);
        }
 public ComputerPlayer(string name, Hand hand)
     : base(name, hand)
 {
 }
Esempio n. 6
0
 public BasePlayer(string name, Hand hand)
 {
     _name = name;
     _hand = hand;
 }
Esempio n. 7
0
 HandObject CreateHand(bool topHand)
 {
     var hand = new Hand(false);
     for (int i = 0; i < 7; i++)
     {
         hand.Cards.Add(_cardsDB.SelectRandomCard());
     }
     var handObject = new HandObject(hand, topHand, height, width, _cardsDB);
     return handObject;
 }
Esempio n. 8
0
 public HumanPlayer(string name, Hand hand)
     : base(name, hand)
 {
 }