private Engine() { this.parser = CommandParser.Instance; this.commandProcessor = CommandProcessor.Instance; this.factory = OlympicsFactory.Instance; this.commitee = OlympicCommittee.Instance; }
protected CreateOlympianCommand(IOlympicCommittee committee, IOlympicsFactory factory) { Guard.WhenArgument(committee, "committee").IsNull().Throw(); Guard.WhenArgument(factory, "factory").IsNull().Throw(); this.committee = committee; this.factory = factory; }
// private readonly IDictionary<string, double> records; public CreateSprinterCommand(IOlympicCommittee committee, IOlympicsFactory factory /*IList<string> commandParameters*/) : base(committee, factory) { //this.records = new Dictionary<string, double>(); //foreach (var recordItem in this.CommandParameters) //{ // var recordValue = recordItem.Split('/'); // this.records.Add(recordValue[0], double.Parse(recordValue[1])); //} }
public Engine( ICommandParser commandParser, ICommandProcessor commandProcessor, IOlympicCommittee committee, IOlympicsFactory factory) { this.parser = commandParser; this.commandProcessor = commandProcessor; this.factory = factory; this.committee = committee; }
public Engine( ICommandParser commandParser, ICommandProcessor commandProcessor, IOlympicCommittee committee, IOlympicsFactory factory, IIOWrapper fakeConsole ) { this.parser = commandParser; this.commandProcessor = commandProcessor; this.factory = factory; this.committee = committee; this.fakeCons = fakeConsole; }
public Engine( ICommandParser commandParser, ICommandProcessor commandProcessor, IOlympicCommittee committee, IOlympicsFactory factory, IReader reader, IWriter writer) { this.parser = commandParser; this.commandProcessor = commandProcessor; this.factory = factory; this.committee = committee; this.reader = reader; this.writer = writer; }
//private readonly string category; //private readonly int wins; //private readonly int losses; public CreateBoxerCommand(IOlympicCommittee committee, IOlympicsFactory factory) : base(committee, factory) { //if(this.CommandParameters.Count != 3) //{ // throw new ArgumentException(GlobalConstants.ParametersCountInvalid); //} //this.category = this.CommandParameters[0]; //bool checkWins = int.TryParse(this.CommandParameters[1], out this.wins); //bool checkLosses = int.TryParse(this.CommandParameters[2], out this.losses); //if (!checkWins || !checkLosses) //{ // throw new ArgumentException(GlobalConstants.WinsLossesMustBeNumbers); //} }
protected CreateOlympianCommand(IOlympicCommittee committee, IOlympicsFactory factory) { Guard.WhenArgument(committee, "committee").IsNull().Throw(); Guard.WhenArgument(factory, "factory").IsNull().Throw(); this.committee = committee; this.factory = factory; //commandParameters.ValidateIfNull(); //this.CommandParameters = commandParameters; //if (commandParameters.Count < 3) //{ // throw new ArgumentException(GlobalConstants.ParametersCountInvalid); //} //this.FirstName = this.CommandParameters[0]; //this.LastName = this.CommandParameters[1]; //this.Country = this.CommandParameters[2]; //this.CommandParameters = this.CommandParameters.Skip(3).ToList(); }
public Command(IList <string> commandLine) { this.committee = OlympicCommittee.Instance; this.factory = OlympicsFactory.Instance; this.CommandParameters = commandLine; }
public CreateBoxerCommand(IOlympicCommittee committee, IOlympicsFactory factory) : base(committee, factory) { }
protected CreateOlympianCommand(IOlympicCommittee committee, IOlympicsFactory factory) : base(committee, factory) { }
public ListOlympiansCommand(IOlympicCommittee committee, IOlympicsFactory factory) : base(committee, factory) { }
protected Command(IOlympicCommittee committee, IOlympicsFactory factory) { this.committee = committee; this.factory = factory; }
public CreateSprinterCommand(IOlympicCommittee committee, IOlympicsFactory factory) : base(committee, factory) { this.records = new Dictionary <string, double>(); }