public CommandInterpreter(List <IWeapon> createdWeapons, IWeaponStorage weaponStorage, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.createdWeapons = createdWeapons; this.weaponStorage = weaponStorage; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; }
public Engine(IRepository repository, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.repository = repository; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; this.commandInterpreter = new CommandInterpreter(this.repository, this.weaponFactory, this.gemFactory); }
protected Command(string[] commandArgs, IRepository weaponRepository, IWeaponFactory weaponFactory, IGemFactory gemFactory) { CommandArgs = commandArgs; WeaponRepository = weaponRepository; WeaponFactory = weaponFactory; GemFactory = gemFactory; }
public AddCommand(IGemFactory gemFactory, IRepository <IWeapon> weaponRepository, string[] arguments) : base(arguments) { this.gemFactory = gemFactory; this.weaponRepository = weaponRepository; }
public Engine(IGemFactory gemFactory, IWeaponFactory weaponFactory, IWeaponRepository weaponRepository, ICommandInterpreter commandInterpreter) { this.gemFactory = gemFactory; this.weaponFactory = weaponFactory; this.weaponRepository = weaponRepository; this.commandInterpreter = commandInterpreter; }
public CommandInterpreter(string[] data, IRepository repository, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.data = data; this.repository = repository; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; }
public AddCommand(string weaponName, int socketIndex, string gemType, IList <IWeapon> weapons) { this.weaponName = weaponName; this.weapons = weapons; this.socketIndex = socketIndex; this.gemType = gemType; this.gemFactory = new GemFactory(); }
public Engine() { this.createdWeapons = new List <IWeapon>(); this.weaponStorage = new WeaponStorage(); this.weaponFactory = new WeaponFactory(); this.gemFactory = new GemFactory(); this.commandInterpreter = new CommandInterpreter(createdWeapons, weaponStorage, weaponFactory, gemFactory); }
public Add( string[] data, IRepository repository, IGemFactory gemFactory) : base(data) { this.Repository = repository; this.GemFactory = gemFactory; }
public void Execute( string[] commandParameters, IDictionary <string, IWeapon> weapons, IWeaponFactory weaponFactory, IInputOutputManager inputOutputManager, IGemFactory gemFactory) { Environment.Exit(0); }
public Engine(IGemFactory gemFactory, IWeaponFactory weaponFactory, ICommandInterpreter commandInterpreter, IRepository repository, IReader reader, IWriter writer) { this.gemFactory = gemFactory; this.weaponFactory = weaponFactory; this.commandInterpreter = commandInterpreter; this.repository = repository; this.reader = reader; this.writer = writer; }
private static Gem CreateGem(string gemInfo, IGemFactory gemFactory) { var gemTokens = gemInfo.Split(); var clarity = Enum.Parse <Clarity>(gemTokens[0]); var gemType = gemTokens[1]; var gem = (Gem)gemFactory.CreateGem(gemType, clarity); return(gem); }
private void AddNewGem(IGemFactory gemFactory, IRepository repo) { string nameOfWeapon = this.Data[1]; int index = int.Parse(this.Data[2]); string claryty = this.Data[3].Split().First(); string gemType = this.Data[3].Split().Last(); IGem gemToAdd = gemFactory.Create(gemType, claryty); var weapon = repo.GetWeapon(nameOfWeapon); weapon.AddGem(index, gemToAdd); }
public Engine( IInputOutputManager inputOutputManager, ICommandDispatcher commandDispatcher, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.inputOutputManager = inputOutputManager; this.commandDispatcher = commandDispatcher; this.weapons = new Dictionary <string, IWeapon>(); this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; }
public void Execute( string[] commandParameters, IDictionary <string, IWeapon> weapons, IWeaponFactory weaponFactory, IInputOutputManager inputOutputManager, IGemFactory gemFactory) { string targetWeaponName = commandParameters[0]; IWeapon targetWeapon = weapons[targetWeaponName]; inputOutputManager.WriteLine($"{targetWeaponName}: {targetWeapon.ToString()}"); }
public Engine( IInputManager inputManager, IOutputManager outputManager, IWeaponRepository weaponDataBase, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.inputManager = inputManager; this.outputManager = outputManager; this.weaponDataBase = weaponDataBase; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; }
public CommandInterpreter( IWeaponRepository weaponRepository, ICommandFactory commandFactory, IWeaponFactory weaponFactory, IGemFactory gemFactory, IOutputWriter outputWriter) { this.weaponRepository = weaponRepository; this.commandFactory = commandFactory; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; this.outputWriter = outputWriter; }
public void Execute( string[] commandParameters, IDictionary <string, IWeapon> weapons, IWeaponFactory weaponFactory, IInputOutputManager inputOutputManager, IGemFactory gemFactory) { string targetAxeName = commandParameters[0]; int socketIndex = int.Parse(commandParameters[1]); IWeapon targetAxe = weapons[targetAxeName]; targetAxe.RemoveGem(socketIndex); }
public CommandInterpreter( IRepository <IWeapon> weaponRepository, IWeaponFactory weaponFactory, IRarityFactory rarityFactory, IGemFactory gemFactory, IClarityFactory clarityFactory, IWriter writer) { this.weaponRepository = weaponRepository; this.weaponFactory = weaponFactory; this.rarityFactory = rarityFactory; this.gemFactory = gemFactory; this.clarityFactory = clarityFactory; this.writer = writer; }
public void Execute( string[] commandParameters, IDictionary <string, IWeapon> weapons, IWeaponFactory weaponFactory, IInputOutputManager inputOutputManager, IGemFactory gemFactory) { string[] tokens = commandParameters[0].Split(' '); string weaponRarity = tokens[0]; string weaponType = tokens[1]; string weaponName = commandParameters[1]; IWeapon weapon = weaponFactory.CreateWeapon(weaponType, weaponRarity); weapons.Add(weaponName, weapon); }
public Engine ( IConsoleRender renderer, IConsoleInputController controller, ICommandFactory commandFactory, IWeaponFactory weaponFactory, IGemFactory gemFactory, IInventory inventory ) { this.renderer = renderer; this.controller = controller; this.CommandFactory = commandFactory; this.WeaponFactory = weaponFactory; this.GemFactory = gemFactory; this.Inventory = inventory; }
public void DispatchCommand( string[] commandParameters, IDictionary <string, IWeapon> weapons, IWeaponFactory weaponFactory, IInputOutputManager inputOutputManager, IGemFactory gemFactory) { string commandName = commandParameters[0]; string[] parameters = commandParameters.Skip(1).ToArray(); if (!this.commands.ContainsKey(commandName)) { throw new InvalidOperationException($"Command {commandName} not valid!"); } this.commands[commandName].Execute(parameters, weapons, weaponFactory, inputOutputManager, gemFactory); }
public Board(Texture2D cellTexture2D, Rectangle boardContainer, int lines, int columns, IGemFactory gemFactory, VectorInput vectorInput) { if (lines == 0 || columns == 0) { throw new ArgumentException("Lines and Columns can't be 0"); } CellTexture2D = cellTexture2D; Gems = new Gem[columns, lines]; Cells = new Rectangle[columns, lines]; var widthCell = boardContainer.Width / columns; var heightCell = boardContainer.Height / lines; var cellSize = Math.Min(widthCell, heightCell); GemOffset = (int)(cellSize * 0.1); GemSize = cellSize - GemOffset * 2; var startX = boardContainer.X + (boardContainer.Width - columns * cellSize) / 2; var startY = boardContainer.Y + (boardContainer.Height - lines * cellSize) / 2; CellColor = new Color(Color.White, 50); GemFactory = gemFactory; for (var x = 0; x < columns; x++) { for (var y = 0; y < lines; y++) { Cells[x, y] = new Rectangle(startX + x * cellSize, startY + y * cellSize, cellSize, cellSize); CreateGem(x, y); } } Lines = lines; Columns = columns; Recalculate = new List <Gem>(Gems.Length); BoardState = BoardState.Move; VectorInput = vectorInput; VectorInput.Press += VectorInputOnPress; }
public Engine() { this.repository = new WeaponRepository(); this.weaponFactory = new WeaponFactory(); this.gemFactory = new GemFactory(); }
public AddCommand(string[] data, IRepository repository, IWeaponFactory weaponFactory, IGemFactory gemFactory) : base(data, repository, weaponFactory, gemFactory) { }
public CommandInterpreter(IWeaponRepository repository, IWeaponFactory weaponFactory, IGemFactory gemFactory) { this.repository = repository; this.weaponFactory = weaponFactory; this.gemFactory = gemFactory; }
public IExecutable CreateCommand(string[] data, IRepository repository, IWeaponFactory weaponFactory, IGemFactory gemFactory) { Assembly assembly = Assembly.GetExecutingAssembly(); Type type = assembly.GetTypes().FirstOrDefault(t => t.Name == data[0] + "Command"); IExecutable executable = (IExecutable)Activator.CreateInstance(type, new object[] { data, repository, weaponFactory, gemFactory }); return(executable); }
public Engine(IWeaponFactory weaponFactory, IGemFactory gemFactory, IRepository repository) { this.commandInterpreter = new CommandInterpreter(weaponFactory, gemFactory, repository); }
public AddCommand(string[] data, IArmory armory, IGemFactory gemFactory) : base(data) { this.Armory = armory; this.GemFactory = gemFactory; }
public AddCommand(string[] data, IWeaponRepository repository, IGemFactory gemFactory) : base(data) { this.repository = repository; this.gemFactory = gemFactory; }