Exemple #1
0
 public Spaceship(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model)
 {
     this.Engine = engine;
     this.Armour = armour;
     this.Weapon = weapon;
     this.Model  = model;
 }
        public IPlayer CreatePlayer(IRegistration playerParameters)
        {
            string name, spaceshipModel, engineModel, armourModel, weaponModel;

            name           = playerParameters.ParametersForPlayer["name"];
            spaceshipModel = playerParameters.ParametersForPlayer["ship"];
            engineModel    = playerParameters.ParametersForPlayer["engine"];
            armourModel    = playerParameters.ParametersForPlayer["armour"];
            weaponModel    = playerParameters.ParametersForPlayer["weapon"];

            ISpaceshipEngine engine = engineFactory.CreateEngine(engineModel);
            IArmour          armour = armourFactory.CreateArmour(armourModel);
            IWeapon          weapon = weaponFactory.CreateWeapon(weaponModel.ToLower());

            weapon.Bullet = bulletFactory.CreateBullet();
            ISpaceShip spaceship = spaceshipFactory.CreateSpaceship(spaceshipModel, engine, armour, weapon);
            IPlayer    player    = playerFactory.CreatePlayer(name, spaceship);

            return(player);
        }
Exemple #3
0
 public DrossMashupSpaceship(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model)
     : base(engine, armour, weapon, model)
 {
 }
        public ISpaceShip CreateSpaceship(string model, ISpaceshipEngine engine, IArmour armour, IWeapon weapon)
        {
            var command = this.autofacContext.ResolveNamed <ISpaceShipService>(model.ToLower());

            return(command.CreateSpaceship(model, engine, armour, weapon));
        }
 public SpaceshipMock(ISpaceshipEngine engine, IArmour armour, IWeapon weapon, string model) : base(engine, armour, weapon, model)
 {
 }
Exemple #6
0
 public void Setup()
 {
     m_SpaceShipEngine = Substitute.For <ISpaceshipEngine>();
     m_Spaceship       = new SpaceShipModel(m_SpaceShipEngine);
 }
Exemple #7
0
 public ISpaceShip CreateSpaceship(string model, ISpaceshipEngine engine, IArmour armour, IWeapon weapon)
 {
     return(new FuturisticSpaceship(engine, armour, weapon, model));
 }