예제 #1
0
 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]));
            //}
        }
예제 #4
0
 public Engine(
     ICommandParser commandParser,
     ICommandProcessor commandProcessor,
     IOlympicCommittee committee,
     IOlympicsFactory factory)
 {
     this.parser           = commandParser;
     this.commandProcessor = commandProcessor;
     this.factory          = factory;
     this.committee        = committee;
 }
예제 #5
0
 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;
 }
예제 #6
0
 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;
 }
예제 #7
0
        //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();
        }
예제 #9
0
 public Command(IList <string> commandLine)
 {
     this.committee         = OlympicCommittee.Instance;
     this.factory           = OlympicsFactory.Instance;
     this.CommandParameters = commandLine;
 }
예제 #10
0
 public CreateBoxerCommand(IOlympicCommittee committee, IOlympicsFactory factory)
     : base(committee, factory)
 {
 }
예제 #11
0
 protected CreateOlympianCommand(IOlympicCommittee committee, IOlympicsFactory factory)
     : base(committee, factory)
 {
 }
예제 #12
0
 public ListOlympiansCommand(IOlympicCommittee committee, IOlympicsFactory factory)
     : base(committee, factory)
 {
 }
예제 #13
0
 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>();
 }