Exemplo n.º 1
0
        public void CorporationHangar()
        {
            var corp = new Corporation();
            var location = new Manufactory();

            var property = corp.GetProperty(location);
            property.Add(new Item(new ItemInfo()));
        }
Exemplo n.º 2
0
        public void CanMove()
        {
            var state = new AgentState();
            var agent = Agent.Builder.Build(state).Build(new TestIdResolver());

            var structure = new Manufactory();
            agent.MoveInto(structure);
        }
Exemplo n.º 3
0
            protected override ObjectBuilder<Structure> BuildStructure(ILocation location)
            {
                var structure = new Manufactory
                {
                    Efficiency = State.Manufactory.Efficiency
                };

                return new ObjectBuilder<Structure>(structure);
            }
Exemplo n.º 4
0
        public void CantUndockWithoutShipSkillLevel()
        {
            var structure = new Manufactory();
            var ship = new Ship { Position = new Position(structure, Vector.Zero), ShipInfo = GetShipInfo() };
            var pilot = new Agent { Skills = { { SkillCode.SpaceshipCommand, new Echo.Agents.Skills.SkillLevel { Level = 1 } } } };

            _task.SetParameters(new UndockShipParameters(ship, pilot));
            var result = (UndockShipResult)_task.Execute();
            Assert.That(result.StatusCode, Is.EqualTo(ShipTask.StatusCode.MissingSkillRequirement));
        }
Exemplo n.º 5
0
        public void CantUndockWithoutShipSkill()
        {
            var structure = new Manufactory();
            var ship = new Ship { Position = new Position(structure, Vector.Zero), ShipInfo = GetShipInfo() };

            var pilot = _universe.John.StandUp();
            pilot.Skills[SkillCode.SpaceshipCommand].Level = 0;

            _task.SetParameters(new UndockShipParameters(ship, pilot));
            var result = (UndockShipResult)_task.Execute();
            Assert.That(result.StatusCode, Is.EqualTo(ShipTask.StatusCode.MissingSkillRequirement));
        }
Exemplo n.º 6
0
        public void CanUndockWithShipSkill()
        {
            var solarSystem = new SolarSystem();
            var structure = new Manufactory { Position = new Position(solarSystem, Vector.Parse("0,1,0")) };
            var ship = new Ship { Position = new Position(structure, Vector.Zero), ShipInfo = GetShipInfo() };
            var pilot = new Agent { Skills = { { SkillCode.SpaceshipCommand, new Echo.Agents.Skills.SkillLevel { Level = 5 } } } };

            _task.SetParameters(new UndockShipParameters(ship, pilot));

            var result = _task.Execute();
            Assert.That(result.Success, Is.True, result.StatusCode);
            Assert.That(ship.Position.LocalCoordinates, Is.EqualTo(structure.Position.LocalCoordinates));
            Assert.That(ship.Position.Location, Is.EqualTo(solarSystem));
        }