public Transport(string sName) { this.sName = sName; this.dPrice = 200; this.dMortgageValue = 100; this.dRent = 50; this.owner = Banker.access(); }
public override bool availableForPurchase() { //if owned by bank then available if (this.owner == Banker.access()) { return(true); } return(false); }
public void testSingleton() { try { //Access banker twice and tests that it is the same object Assert.AreSame(Banker.access(), Banker.access()); } catch (NotImplementedException ex) { Console.WriteLine("A part of the program is yet to be implemented"); } }
public override string landOn(ref Player player) { //Pay rent if needed if ((this.getOwner() != Banker.access()) && (this.getOwner() != player)) { //pay rent this.payRent(ref player); return(string.Format("You rolled a total of {0}. So your rent is {0} x {1} = ${2}.", player.getLastMove(), Utility.rentMultiplier, (player.getLastMove() * Utility.rentMultiplier))); } else { return(base.landOn(ref player)); } }
public override string landOn(ref Player player) { //Pay rent if needed if ((this.getOwner() != Banker.access()) && (this.getOwner() != player)) { //pay rent this.payRent(ref player); return(base.landOn(ref player) + string.Format("Rent has been paid for {0} of ${1} to {2}.", this.getName(), this.getRent(), this.getOwner().getName())); } else { return(base.landOn(ref player)); } }
public override void checkBankrupt() { if (this.getBalance() <= 0) { //raise the player bankrupt event if there are subscribers if (playerBankrupt != null) { this.playerBankrupt(this, new EventArgs()); } //return all the properties to the bank Banker b = Banker.access(); foreach (Property p in this.getPropertiesOwnedFromBoard()) { p.setOwner(ref b); } //set isInactive to true this.isInactive = true; } }
public Utility(String name) { this.sName = name; this.owner = Banker.access(); }
public Property(string sName) { this.sName = sName; this.owner = Banker.access(); }