private void btnExecute_Click(object sender, EventArgs e)
        {
            string           sportsmenName = txtSportsmenName.Text.Trim();
            StrategyRun      run           = StrategyRunFactory.make(cbRun.SelectedItem.ToString());
            StrategyJump     jump          = StrategyJumpFactory.make(cbJump.SelectedItem.ToString());
            StrategySwim     swim          = StrategySwimFactory.make(cbSwim.SelectedItem.ToString());
            Sportsmen        sportsmen     = new Sportsmen(sportsmenName, run, jump, swim);
            SportsmenCommand cmd           = (SportsmenCommand)lbCommands.SelectedItem;

            txtLog.AppendText(sportsmen.execute(cmd) + Environment.NewLine);
        }
Esempio n. 2
0
 public SportsmenCommandMultiply(string name, SportsmenCommand cmd, int count) : base(name)
 {
     this.cmd   = cmd;
     this.count = count;
 }
Esempio n. 3
0
 public string execute(SportsmenCommand cmd)
 {
     return(name + ": " + cmd.execute(this));
 }