public static IExecutable CreateCommmand(string[] lineTokens, IFootballTeamCollection footballTeamCollection) { string commandName = lineTokens[0]; string[] toProcess = lineTokens.Skip(1).ToArray(); object[] parametersForConstructin = new object[] { footballTeamCollection, toProcess }; Type commandType = Assembly.GetExecutingAssembly() .GetTypes() .First(t => t.Name == commandName); IExecutable cmd = (IExecutable)Activator.CreateInstance(commandType, parametersForConstructin); return(cmd); }
public Engine(IReader reader, IWriter writer, IOutputStoreManager outputStoreManager, ICommandSplit lineSplit, IFootballTeamCollection footballTeamCollection) { this.Reader = reader; this.Writer = writer; this.OutputStoremanager = outputStoreManager; this.LineSplitter = lineSplit; this.FootballTeamCollection = footballTeamCollection; }
public Remove(IFootballTeamCollection footballTeamCollection, string[] commandTokens) : base(footballTeamCollection, commandTokens) { }
public Command(IFootballTeamCollection footballTeamCollection, string[] commandTokens) { this.FootballTeamCollection = footballTeamCollection; this.CommandTokens = commandTokens; }