예제 #1
0
        public void CorporationHangar()
        {
            var corp = new Corporation();
            var location = new Manufactory();

            var property = corp.GetProperty(location);
            property.Add(new Item(new ItemInfo()));
        }
예제 #2
0
파일: AgentTests.cs 프로젝트: andy-uq/Echo
        public void CanMove()
        {
            var state = new AgentState();
            var agent = Agent.Builder.Build(state).Build(new TestIdResolver());

            var structure = new Manufactory();
            agent.MoveInto(structure);
        }
예제 #3
0
파일: Manufactory.cs 프로젝트: andy-uq/Echo
            protected override ObjectBuilder<Structure> BuildStructure(ILocation location)
            {
                var structure = new Manufactory
                {
                    Efficiency = State.Manufactory.Efficiency
                };

                return new ObjectBuilder<Structure>(structure);
            }
예제 #4
0
파일: UndockTask.cs 프로젝트: andy-uq/Echo
        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));
        }
예제 #5
0
파일: UndockTask.cs 프로젝트: andy-uq/Echo
        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));
        }
예제 #6
0
파일: UndockTask.cs 프로젝트: andy-uq/Echo
        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));
        }