コード例 #1
0
ファイル: GoToJail.cs プロジェクト: larry126/Monopoly
 public override void PerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.GoToJail)
     {
         player.MoveTo(_gameState.CurrentBoard.ToList().FindIndex(s => s.Name == "Jail"), false, true);
     }
 }
コード例 #2
0
ファイル: GoToJail.cs プロジェクト: larry126/Monopoly
 public override bool CanPlayerPerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.GoToJail)
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
 public override void PerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.Rent)
     {
         player.PayMoney(tax);
     }
     else
     {
         player.PayMoney(tax);
     }
 }
コード例 #4
0
 public override bool CanPlayerPerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.Tax)
     {
         return(player.IsAbleToAfford(tax) || player.IsAbleToAfford((int)(player.GetTotalAssests() * 0.1)));
     }
     else
     {
         return(player.IsAbleToAfford(tax));
     }
 }
コード例 #5
0
ファイル: Railway.cs プロジェクト: larry126/Monopoly
 public override bool CanPlayerPerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.Buy)
     {
         return(player.IsAbleToAfford(Price));
     }
     else if (action == LandOnActions.Rent)
     {
         return(player.IsAbleToAfford(GetRent()));
     }
     return(false);
 }
コード例 #6
0
 public override void PerformAction(Player player, LandOnActions action)
 {
     if (action == LandOnActions.Buy)
     {
         player.PayMoney(Price);
         _owner = player;
     }
     else if (action == LandOnActions.Rent)
     {
         player.PayMoney(GetRent());
     }
 }
コード例 #7
0
ファイル: Lottery.cs プロジェクト: larry126/Monopoly
 public override void PerformAction(Player player, LandOnActions action)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
ファイル: Lottery.cs プロジェクト: larry126/Monopoly
 public override bool CanPlayerPerformAction(Player player, LandOnActions action)
 {
     return(false);
 }
コード例 #9
0
 public override void PerformAction(Player player, LandOnActions action)
 {
 }