public HandObject(Hand hand, bool topHand, int cardHeight, int cardWidth, CardDatabase cardsDB)
 {
     _hand = hand;
     _cardHeight = cardHeight;
     _cardWidth = cardWidth;
     _topHand = topHand;
     _cardsDB = cardsDB;
 }
Beispiel #2
0
 public State(IPlayer player1, IPlayer player2, Hand hand1, Hand hand2)
 {
     GameOver = false;
     ActivePlayer = player1;
     OtherPlayer = player2;
     ActiveHand = hand1;
     OtherHand = hand2;
 }
Beispiel #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;
        }
Beispiel #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)
 {
 }
 public BasePlayer(string name, Hand hand)
 {
     _name = name;
     _hand = hand;
 }
Beispiel #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;
 }
 public HumanPlayer(string name, Hand hand)
     : base(name, hand)
 {
 }