private SelectListItem CreateShipOption(ShipSpecification x)
 {
     return(new SelectListItem
     {
         Text = x.Faction + " - " + x.Name,
         Value = x.Code,
     });
 }
示例#2
0
        /* (During the first turn of a scenario, the ship has additional energy tokens
         *  equal to the number of batteries on the ship, representing power stored in the batteries. )
         */
        public void Initialize(ShipSpecification spec)
        {
            ShipInternals = new ShipInternals(spec);

            foreach (var shipStateAvailableBattery in ShipInternals.AvailableBatteries)
            {
                shipStateAvailableBattery.IsCharged = true;
            }
        }
示例#3
0
 public static Pawn FromSpecification(ShipSpecification spec)
 {
     return(new Pawn
     {
         Id = Guid.NewGuid(),
         SpecificationCode = spec.Code,
         ComponentsRemaining = spec.Components.ToDictionary(x => x.Key, x => x.Value)
     });
 }
示例#4
0
        public ShipInternals(ShipSpecification spec)
        {
            _spec = spec;


            InitializeEnergyLoadout(spec.Loadout.EnergyLoadout);
            InitializeStructureLoadout(spec.Loadout.StructureLoadout);
            InitializeSystemsLoadout(spec.Loadout.SystemsLoadout);
            InitializeWeaponsLoadout(spec.Loadout.Weapons);

            _shields[Hex.Direction(0)] = new Shield(spec.ShieldStrength[Hex.Direction(0)]);
            _shields[Hex.Direction(1)] = new Shield(spec.ShieldStrength[Hex.Direction(1)]);
            _shields[Hex.Direction(2)] = new Shield(spec.ShieldStrength[Hex.Direction(2)]);
            _shields[Hex.Direction(3)] = new Shield(spec.ShieldStrength[Hex.Direction(3)]);
            _shields[Hex.Direction(4)] = new Shield(spec.ShieldStrength[Hex.Direction(4)]);
            _shields[Hex.Direction(5)] = new Shield(spec.ShieldStrength[Hex.Direction(5)]);

            DamageControl = new DamageControl
            {
                RepairPointsPool       = 0,
                RepairPointsProduction = _spec.DamageControlRating
            };
        }
示例#5
0
 public void Repair(ShipSpecification spec)
 {
     ComponentsRemaining = spec.Components.ToDictionary(x => x.Key, x => x.Value);
 }