【发布时间】:2014-03-19 16:03:43
【问题描述】:
这是我的源代码的一部分:
var result = DiceWebAPI.PlaceAutomatedBets(
Session, baseBet, guessLow, guessHigh,
betCount > Session.MaxBetBatchSize ? Session.MaxBetBatchSize : betCount,
resetOnWin, resetOnLoss,
increaseOnWin, increaseOnLoss,
maxBet, resetOnMaxLoss, stopOnMaxLoss, stopMaxBalance);
viusal c# studio 2010 说:
Error 1 No overload for method 'PlaceAutomatedBets' takes 13 arguments D:\Downloads\SampleBot_NET_3_5\SampleBot_NET_Source\Dice.Sample.Bot.3_5\Main.cs 359 30 DiceSampleBot35
我发现方法的所有参数都有定义,除了会话之一。谁能告诉我如何写以及在哪里放置定义?
也许会有所帮助:
在另一个文件中
readonly SessionInfo Session;
在另一个
namespace Dice.Client.Web
{
public sealed class SessionInfo : INotifyPropertyChanged
{
public string AccountCookie { get; }
public long AccountId { get; }
public decimal Balance { get; }
public long BetCount { get; }
public decimal BetPayIn { get; }
public decimal BetPayOut { get; }
public long BetWinCount { get; }
public long ClientSeed { get; }
public string DepositAddress { get; }
public string Email { get; }
public string EmergencyAddress { get; }
public int MaxBetBatchSize { get; }
public string SessionCookie { get; }
public string Username { get; }
public event PropertyChangedEventHandler PropertyChanged;
}
}
更新:
PlaceAutomdBets.. 定义
public static PlaceAutomatedBetsResponse PlaceAutomatedBets(SessionInfo session, AutomatedBetsSettings settings);
【问题讨论】:
-
如果你想改变构造函数,你需要 DiceWebAPI 的源代码。
-
您可以将签名发布到在 DiceWebAPI 上定义 PlaceAutomdBets 的位置吗?
-
@RobLang public static PlaceAutomatedBetsResponse PlaceAutomatedBets(SessionInfo session, AutomatedBetsSettings 设置);在命名空间 Dice.Client.Web { public static class DiceWebAPI { (...) } } 的一部分
-
您能否将其添加到问题中。
AutomatedBetsSettings的内容也可以发一下吗?看起来您是手动输入所有设置,而不是先构建一个AutomatedBetsSettings对象并将其传入。
标签: c# object definition overloading