//override the landOn method
        public override string landOn(ref Player player)
        {
            //if we have pulled the complete deck we need to reshuffle
            if (this.cardPulled >= this.CommunityCardsActions.Count) this.ShuffleCards();

            theCurrentBank = Banker.access();
            string drawedCord = draw_card(player);
            return base.landOn(ref player) + String.Format(drawedCord);
        }
Beispiel #2
0
 public void setOwner(ref Banker newOwner)
 {
     this.owner = newOwner;
 }
Beispiel #3
0
 //method to access singleton
 public static Banker access()
 {
     if (banker == null)
         banker = new Banker();
     return banker;
 }
        public void test_PlayerGettersAndSetters()
        {
            Banker theTestBanker = new Banker();
             Player theTestPlayer = new Player();

            //hasRolledDoubles bool
            theTestPlayer.get_hasRolledDoubles();
            theTestPlayer.is_hasRolledDoubles();
            theTestPlayer.hasRolledDoubles = true;
            theTestPlayer.not_hasRolledDoubles();

            //paidFine bool
            theTestPlayer.getPaidFine();
            theTestPlayer.isPaidFine();
            theTestPlayer.notPaidFine();

            //landedInJailByThreeStraightDoubles bool
            theTestPlayer.get_LandedInJailByThreeStraightDoubles();
            theTestPlayer.not_LandedInJailByThreeStraightDoubles();
            theTestPlayer.is_LandedInJailByThreeStraightDoubles();

            //inJail bool
            theTestPlayer.getJailStats();
            theTestPlayer.setIsInJail();
            theTestPlayer.setNotInJail();

            //lastMove int
            theTestPlayer.getLastMove();

            theTestPlayer.getLocation();

            theTestPlayer.getName();

            theTestPlayer.getPropertiesOwned();

            theTestPlayer.getBalance();

            theTestPlayer.getBalance();

            theTestPlayer.hasRolledDoublesInJail();

            theTestPlayer.isNotActive();

            theTestPlayer.get_firstTurnInJail();

            theTestPlayer.not_firstTurnInJail();
        }
Beispiel #5
0
 public void setOwner(ref Banker newOwner)
 {
     this.owner = newOwner;
 }
Beispiel #6
0
 public Property(string sName)
 {
     this.sName = sName;
     this.owner = Banker.access();
 }