Exemplo n.º 1
0
        static Design()
        {
            militiaDesign          = new Design <Troop>();
            militiaDesign.BaseName = "Militia";
            var militiaWeapon = new ComponentTemplate();

            militiaWeapon.Durability = Mod.Current.Settings.MilitiaHitpoints;
            militiaWeapon.Name       = "Small Arms";
            militiaWeapon.WeaponInfo = new DirectFireWeaponInfo
            {
                Damage   = Mod.Current.Settings.MilitiaFirepower,
                MinRange = 0,
                MaxRange = 1,
            };
            militiaDesign.Components.Add(new MountedComponentTemplate(militiaDesign, militiaWeapon));
        }
Exemplo n.º 2
0
        public static IDesign Create(VehicleTypes vt)
        {
            IDesign d;

            switch (vt)
            {
            case VehicleTypes.Ship:
                d = new Design <Ship>();
                break;

            case VehicleTypes.Base:
                d = new Design <Base>();
                break;

            case VehicleTypes.Fighter:
                d = new Design <Fighter>();
                break;

            case VehicleTypes.Troop:
                d = new Design <Troop>();
                break;

            case VehicleTypes.Mine:
                d = new Design <Mine>();
                break;

            case VehicleTypes.Satellite:
                d = new Design <Satellite>();
                break;

            case VehicleTypes.Drone:
                d = new Design <Drone>();
                break;

            case VehicleTypes.WeaponPlatform:
                d = new Design <WeaponPlatform>();
                break;

            default:
                throw new Exception("Cannot create a design for vehicle type " + vt + ".");
            }
            d.Owner = Empire.Current;
            return(d);
        }