private bool CanUse(ShipInfo shipInfo) { Ensure.That(shipInfo).IsNotNull(); return CanUse(shipInfo.PilotRequirements); }
public void SetUp() { _solarSystem = new SolarSystem(); _asteroid = new AsteroidBelt { Ore = ItemCode.Veldnium, Difficulty = 1, Richness = 500, AmountRemaining = 1000, Position = new Position(_solarSystem, Vector.Parse("1,0")) }; _difficultAsteroid = new AsteroidBelt { Ore = ItemCode.Veldnium, Difficulty = 2, Richness = 500, AmountRemaining = 1000, Position = new Position(_solarSystem, Vector.Parse("1,0")) }; _solarSystem.Satellites.Add(_asteroid); var shipInfo = new ShipState(ItemCode.LightFrigate) { HardPoints = new[] { new HardPointState { Position = HardPointPosition.Bottom, Weapon = new WeaponState { Code = ItemCode.MiningLaser }, Speed = 1d }, new HardPointState { Position = HardPointPosition.Top, Weapon = new WeaponState { Code = ItemCode.MissileLauncher } } } }; var builder = Ship.Builder.Build(_solarSystem, shipInfo); var frigate = new ShipInfo { Code = ItemCode.LightFrigate }; var missileLauncher = TestItems.Weapon(ItemCode.MissileLauncher); var miningLaser = TestItems.Weapon(ItemCode.MiningLaser); IIdResolver resolver = new IdResolutionContext(new IObject[] { missileLauncher, miningLaser, frigate }); _ship = builder.Build(resolver); }