public void LoadBoard(BoardDefinition boardDefinition) { //Aqui tengo que procesar alguna estructura que me diga los bloques //Construyo una lista de bloques ya con los observables, etc y se la enchufo al board List <IBlock> blocks = new List <IBlock>(); List <IBlock> irromptableBlocks = new List <IBlock>(); var shooterFactory = new ShooterFactory(Configuration, _resourceRepository, SpaceShip); var prizeFactory = new PrizeFactory(this, _resourceRepository, shooterFactory); BlockBuilder builder = new BlockBuilder(this, prizeFactory); builder.Configuration(Configuration); foreach (BlockDefinition blockDefinition in boardDefinition.BloksDefinition) { var block = builder.Position(blockDefinition.Position).Type(blockDefinition.Type).Build(); AddBlock(block); blocks.Add(block); } foreach (BlockDefinition blockDefinition in boardDefinition.IrromptableBlocksDefinition) { var block = builder.Position(blockDefinition.Position).Type(blockDefinition.Type).Build(); AddBlock(block); irromptableBlocks.Add(block); } Board = new Board(blocks, irromptableBlocks, Configuration.ScreenSize, Balls[0].Size.Width * Balls[0].Scale.X); //Y si quiero bolas mas grandes?!?!?! }
/// <summary> /// Create the teams and all shooters on the teams. /// </summary> private void CreateTeams() { for (int i = 0; i < TeamCount; i++) { Teams[i] = ShooterFactory.CreateShooterTeam(i, TeamData[i]); Players[i].Team = Teams[i]; } }
public PrizeFactory(IComponentManager componentManager, ResourceRepository resourceRepository, ShooterFactory shooterFactory) { _componentManager = componentManager; _resourceRepository = resourceRepository; _shooterFactory = shooterFactory; }
public BasicShooterPrize(Vector2 initialPosition, Size size, ISpaceShip spaceShip, ShooterFactory shooterFactory) : base(initialPosition, size, spaceShip) { _shooterFactory = shooterFactory; }