本文整理汇总了C#中Player.setBalance方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setBalance方法的具体用法?C# Player.setBalance怎么用?C# Player.setBalance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.setBalance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _landOn_Community
public void _landOn_Community()
{
CommunityCards community = new CommunityCards("Jim", false, 10);
Player thePlayer = new Player("Jim");
thePlayer.setBalance(100);
Board.access().addPlayer(thePlayer);
String response = community.landOn(ref thePlayer);
StringAssert.Contains("You've drawn Community Card", response);
}
示例2: _landOn_chance
public void _landOn_chance()
{
ChanceCards chance = new ChanceCards("Jim", false, 10);
Player play = new Player("Jim");
play.setBalance(100);
Board.access().addPlayer(play);
String response = chance.landOn(ref play);
StringAssert.Contains("You've drawn a Chance Card", response);
}
示例3: LuckTests_landOn_penality
public void LuckTests_landOn_penality()
{
//set luck not to draw card
Luck luckTest = new Luck("Jim", false, 10);
Player thePlayer = new Player("Jim");
thePlayer.setBalance(100);
Board.access().addPlayer(thePlayer);
String response = luckTest.landOn(ref thePlayer);
StringAssert.Contains("has paid", response);
}
示例4: test_checkBankrupt
public void test_checkBankrupt()
{
//check bankrump we will set balance to 0 and return props to bank
Player thePlayer = new Player("Jim");
thePlayer.setBalance(0);
Transport transFactory = new Transport("Wellington Railway Station");
transFactory.setOwner(ref thePlayer);
Board.access().addPlayer(thePlayer);
Board.access().addProperty(transFactory);
thePlayer.checkBankrupt();
Assert.IsTrue(transFactory.getOwner() == Banker.access());
}
示例5: test_BriefDetailsToString
public void test_BriefDetailsToString()
{
Player play = new Player("Jim");
play.setBalance(1500);
Property proper = new Property("Garden");
proper.setOwner(ref play);
Board.access().addProperty(proper);
//check first rolltheProp
StringAssert.Contains("1500", play.BriefDetailsToString());
//second roll should not allow
// Rolled double out of jail
}
示例6: testChestCardList
public void testChestCardList()
{
testChanceCards.ShuffleCards();
//get the card list
List<Actionable> theCards = testChanceCards.CardList();
//check that the list is not empty
Assert.IsNotEmpty(testChanceCards.CardList());
Banker.access().setBalance(20000);
Player testPlayer = new Player();
testPlayer.setBalance(1000);
Board.access().addPlayer(testplayer);
testChanceCards.draw_card(testplayer);
foreach (Actionable i in theCards)
{
i.Action.Invoke();
Assert.IsNotEmpty(i.Name);
}
}
示例7: test_payJailFee
public void test_payJailFee()
{
//check bankrump we will set balance to 0 and return props to bank
Player play = new Player("Jim");
play.setBalance(100);
//play.setInJail();
//play.pay("50");
Assert.IsTrue(play.getBalance() == 50);
Assert.IsFalse(play.getInJail());
}
示例8: TestMortgageProp
public void TestMortgageProp()
{
Board.access().ClearBoard();
//clear console.log
theConsoleReader.clear();
Player testplayer2 = new Player();
testplayer.setBalance(500);
testplayer2.setBalance(500);
Board.access().addProperty(resFactory.create("Te Puke, Giant Kiwifruit", 60, 6, 50));
Assert.IsTrue(((TradeableProperty)Board.access().getProperty(0)).availableForPurchase());
Board.access().getProperty(0).setOwner(ref testplayer);
((TradeableProperty)Board.access().getProperty(0)).landOn(ref testplayer2);
((TradeableProperty)Board.access().getProperty(0)).payRent(ref testplayer);
Board.access().getProperty(0).mortgageProperty();
//testing tradeable class
((TradeableProperty)Board.access().getProperty(0)).payRent(ref testplayer);
//theConsoleReader
Assert.Contains("This property has been mortgaged, you do not need to pay rent: ", theConsole.getOutput());
Assert.IsFalse(((TradeableProperty)Board.access().getProperty(0)).availableForPurchase());
Assert.IsFalse(((Property)Board.access().getProperty(0)).availableForPurchase());
//check_mortgaged_status
Assert.IsTrue(Board.access().getProperty(0).isMortgaged);
Assert.AreNotEqual(500, testplayer.getBalance());
}
示例9: TestUnMortgageProp
public void TestUnMortgageProp()
{
Board.access().ClearBoard();
testplayer.setBalance(500);
Board.access().addProperty(resFactory.create("Te Puke, Giant Kiwifruit", 60, 6, 50));
Board.access().getProperty(0).setOwner(ref testplayer);
Board.access().getProperty(0).mortgageProperty();
Board.access().getProperty(0).unMortgageProperty();
Assert.IsFalse(Board.access().getProperty(0).isMortgaged);
Assert.AreNotEqual(500, testplayer.getBalance());
testplayer = new Player();
testplayer.setBalance(-1000);
Board.access().getProperty(0).setOwner(ref testplayer);
((Property)Board.access().getProperty(0)).mortgageProperty();
((Residential)Board.access().getProperty(0)).addHouse();
((Residential)Board.access().getProperty(0)).SellHouses();
Assert.IsTrue(((Residential)Board.access().getProperty(0)).getMortgageValue() == 30);
Assert.IsTrue(((Residential)Board.access().getProperty(0)).getHotelCount() == 0);
((Property)Board.access().getProperty(0)).mortgageProperty();
((Property)Board.access().getProperty(0)).unMortgageProperty();
}