You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
735 B
32 lines
735 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Command
|
|
{
|
|
internal class User
|
|
{
|
|
private List<ICommand> _commands = new List<ICommand>();
|
|
|
|
public void AddCommand(ICommand command)
|
|
{
|
|
_commands.Add(command);
|
|
}
|
|
|
|
public void AddCommand(StockBroker broker, string symbol, TxType txType, int qty)
|
|
{
|
|
ICommand command = new StockCommand(broker, symbol, txType, qty);
|
|
_commands.Add(command);
|
|
}
|
|
|
|
public void ExecuteAll()
|
|
{
|
|
foreach (ICommand cmd in _commands)
|
|
{
|
|
cmd.Execute();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|