/// <summary>
 /// initializing constructor.
 /// </summary>
 /// <param name="star">Star with this production queue.</param>
 /// <param name="shipDesign"><see cref="ShipDesign"/> to produce.</param>
 public ShipProductionUnit(ShipDesign shipDesign)
 {
     designKey     = shipDesign.Key;
     name          = shipDesign.Name;
     cost          = shipDesign.Cost;
     remainingCost = cost;
 }
Beispiel #2
0
    public void CreateEntity(Vector3Int location, ShipDesign design)
    {
        var loc = StarSystem.TileToWorld(location);
        var obj = Instantiate(Entity, loc, Entity.transform.rotation);
        var atr = obj.GetComponent <Attributes>();

        atr.Id         = BaseAttributes.GetId();
        atr.StarSystem = StarSystem;
        atr.Empire     = this;
        atr.Location   = location;
        var br = obj.GetComponent <EntityBrain>();

        br.StarSystem        = StarSystem;
        br.Movement          = obj.GetComponent <EntityMovement>();
        br.Movement.Location = location;
        var ti = obj.GetComponent <TickControlScript>();

        ti.StarSystem         = StarSystem;
        atr.TickControlScript = ti;

        EntityManager.Entities.Add(atr);
        Ships.Add(br);
        obj.name = $"{Id}:{design.Name}:{atr.Id}";

        atr.Initialize(design);

        OnBuildShip?.Invoke(location, atr);
    }
Beispiel #3
0
        /// <Summary>
        /// Display Design
        /// </Summary>
        /// <param name="design">The <see cref="ShipDesign"/> to display.</param>
        private void DisplayDesign(ShipDesign design)
        {
            design.Update();
            Hull hullProperties = design.Hull;

            this.hullGrid.ActiveModules = hullProperties.Modules;
            this.hullImage.Image        = design.Blueprint.ComponentImage;
            this.designResources.Value  = design.Cost;
            this.designName.Text        = design.Name;
            this.shipMass.Text          = design.Mass.ToString(System.Globalization.CultureInfo.InvariantCulture);
            this.shipArmor.Text         = design.Armor.ToString(System.Globalization.CultureInfo.InvariantCulture);
            this.shipShields.Text       = design.Shield.ToString(System.Globalization.CultureInfo.InvariantCulture);
            this.cargoCapacity.Text     = design.CargoCapacity.ToString(System.Globalization.CultureInfo.InvariantCulture);

            if (design.Type == ItemType.Starbase)
            {
                this.capacityType.Text  = "Dock Capacity";
                this.capacityUnits.Text = "kT";
                this.maxCapacity.Text   = design.DockCapacity.ToString(System.Globalization.CultureInfo.InvariantCulture);
            }
            else
            {
                this.capacityType.Text  = "Fuel Capacity";
                this.capacityUnits.Text = "mg";
                this.maxCapacity.Text   = design.FuelCapacity.ToString(System.Globalization.CultureInfo.InvariantCulture);
            }
        }
Beispiel #4
0
        /// <Summary>
        /// Save the the design when the OK button is pressed
        /// </Summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A <see cref="EventArgs"/> that contains the event data.</param>
        private void OK_Click(object sender, System.EventArgs e)
        {
            ShipDesign newDesign      = new ShipDesign(clientState.EmpireState.GetNextDesignKey());
            Hull       hullProperties = selectedHull.Properties["Hull"] as Hull;

            hullProperties.Modules = HullGrid.ActiveModules;
            newDesign.Name         = DesignName.Text;
            newDesign.Owner        = clientState.EmpireState.Id;
            newDesign.Blueprint    = selectedHull;
            newDesign.Icon         = shipIcon;
            newDesign.Update();

            if (hullProperties.IsStarbase)
            {
                newDesign.Type = ItemType.Starbase;
            }
            else
            {
                newDesign.Type = ItemType.Ship;
                if (newDesign.Engine == null)
                {
                    Report.Error("A ship design must have an engine");
                    return;
                }
            }
            DesignCommand command = new DesignCommand(CommandMode.Add, newDesign);

            if (command.IsValid(clientState.EmpireState))
            {
                clientState.Commands.Push(command);
                command.ApplyToState(clientState.EmpireState);
            }
            Close();
        }
 public void Draw(ShipDesign selected)
 {
     if (selected == Design)
     {
         if (GUI.Button(selectRect, Design.Name, ButtonActiveStyle))
         {
             buttonCallBack(Design);
             AudioManager.instance.PlayUIClip("SelectButtonClick");
         }
         if (GUI.Button(DeleteRect, "X", ButtonActiveStyle))
         {
             deleteCallBack(Design);
             PlayMainButtonClick();
         }
     }
     else
     {
         if (GUI.Button(selectRect, Design.Name))
         {
             buttonCallBack(Design);
             AudioManager.instance.PlayUIClip("SelectButtonClick");
         }
         if (GUI.Button(DeleteRect, "X"))
         {
             deleteCallBack(Design);
             PlayMainButtonClick();
         }
     }
 }
Beispiel #6
0
 public ProductionQueueItem(QueueItemType type, int quantity, ShipDesign shipDesign, string fleetName) : base()
 {
     this.type       = type;
     this.quantity   = quantity;
     this.shipDesign = shipDesign;
     this.fleetName  = fleetName;
 }
Beispiel #7
0
        /// <summary>
        /// Load from XML: Initializing constructor from an XML node.
        /// </summary>
        /// <param name="node">An <see cref="XmlNode"/> within
        /// a Nova component definition file (xml document).
        /// </param>
        public DesignCommand(XmlNode node)
        {
            XmlNode mainNode = node.FirstChild;

            while (mainNode != null)
            {
                switch (mainNode.Name.ToLower())
                {
                case "mode":
                    Mode = (CommandMode)Enum.Parse(typeof(CommandMode), mainNode.FirstChild.Value);
                    break;

                case "design":
                    Design = new ShipDesign(mainNode);
                    break;

                case "shipdesign":
                    Design = new ShipDesign(mainNode);
                    break;

                case "key":     // occurs if CommandMode is Delete
                    Design = new ShipDesign(long.Parse(mainNode.FirstChild.Value, System.Globalization.CultureInfo.InvariantCulture));
                    break;
                }

                mainNode = mainNode.NextSibling;
            }
        }
Beispiel #8
0
        /// <summary>
        /// Calculate weapon power. For beam weapons, this damage will dissipate over
        /// the range of the beam (no dissipation at range 0, 5% dissipation at range 1,
        /// 10% dissipation at range 2 and 15% at range 3). Also capacitors and
        /// deflectors will modify the weapon power.
        ///
        /// For missiles, the power is simply the base power.
        /// </summary>
        /// <param name="ship">Firing ship.</param>
        /// <param name="weapon">Firing weapon.</param>
        /// <param name="target">Ship being fired on.</param>
        /// <returns>Damage weapon is able to do.</returns>
        private double CalculateWeaponPower(ShipDesign ship, Weapon weapon, ShipDesign target)
        {
            // TODO (priority 5) Stub - just return the base power of weapon. Also need to comment the return value of this function with what defenses have been considered by this (when done).
            return(weapon.Power);

            /*
             * double weaponPower = weapon.GetPower(ship);
             *
             * if (weapon.WeaponType == "Beam") {
             * weaponPower -= Math.Pow(0.9, target.Design.BeamDeflectors);
             *
             * switch (weapon.Range) {
             * case 1:
             *   weaponPower *= 0.95;             // 5% reduction
             *   break;
             * case 2:
             *   weaponPower *= 0.9;              // 10% reduction
             *   break;
             * case 3:
             *   weaponPower *= 0.85;             // 15% reduction
             *   break;
             * default:
             *   Report.Error("Unexpected beam range");
             *   break;
             * }
             * }
             *
             * return weaponPower;
             * */
        }
Beispiel #9
0
 /// <summary>
 /// Creates a token of ships.
 /// </summary>
 /// <param name="newDesign">The ship design of this token.</param>
 /// <param name="quantity">The amount of ships in this token.</param>
 public ShipToken(ShipDesign newDesign, int quantity)
 {
     Design   = newDesign;
     Quantity = quantity;
     Armor    = newDesign.Armor * quantity;
     Shields  = newDesign.Shield;
 }
Beispiel #10
0
    /**
     * Add a ShipStack to the fleet
     */
    public ShipStack addShipStack(ShipDesign design, int quantity)
    {
        ShipStack stack = new ShipStack(design, quantity);

        shipStacks.Add(stack);
        return(stack);
    }
Beispiel #11
0
        public void Init()
        {
            fleets = new List <Fleet>();
            Fleet fleet = new Fleet(1);

            fleet.Owner = 1;
            ShipDesign shipDesign = new ShipDesign(1);
            ShipToken  shipToken  = new ShipToken(shipDesign, 1);

            fleet.Composition.Add(shipToken.Key, shipToken);
            fleets.Add(fleet);
            Waypoint      waypoint = new Waypoint();
            IWaypointTask task     = new ScrapTask();

            waypoint.Task        = task;
            waypoint.Destination = "Star1";
            fleet.Waypoints.Add(waypoint);
            serverData = new SimpleServerData();
            Star star = new Star();

            star.Name = "Star1";
            serverData.AllStars.Add(star.Key, star);
            empireData    = new SimpleEmpireData();
            empireData.Id = 1;
            empireData.OwnedFleets.Add(fleet);
            serverData.AllEmpires.Add(empireData.Id, empireData);
            Console.WriteLine(fleets.First().Composition.Count());
            Assert.AreEqual(fleets.First().Composition.Count(), 1);
        }
Beispiel #12
0
    /**
     * Build any new scout fleets
     */
    private void buildFleets(List <Planet> buildablePlanets, int numShipsNeeded, ShipDesign scoutShip)
    {
        if (scoutShip != null)
        {
            int queuedToBeBuilt = 0;

            List <Planet> planetsToBuildOn = new List <Planet>();
            foreach (Planet planet in buildablePlanets)
            {
                bool isBuilding = false;
                foreach (ProductionQueueItem item in planet.getQueue().getItems())
                {
                    if (item.getShipDesign() != null && item.getShipDesign().getAggregate().isColoniser())
                    {
                        isBuilding = true;
                        queuedToBeBuilt++;
                    }
                }

                if (!isBuilding)
                {
                    planetsToBuildOn.Add(planet);
                }
            }

            foreach (Planet planet in planetsToBuildOn)
            {
                if (queuedToBeBuilt < numShipsNeeded)
                {
                    planet.addQueueItem(QueueItemType.Fleet, 1, scoutShip);
                    queuedToBeBuilt++;
                }
            }
        }
    }
Beispiel #13
0
    public void SaveAsDesign()
    {
        OnChange();
        if (!RequirementsMet)
        {
            Debug.Log("Requirements not met. DEBUG MODE ENABLED, output will continue anyway.");
            //	return;
        }
        ShipDesign design = new ShipDesign(DesignName.text);

        design.HullDesignation = HullDes.DesDictionary[HullDesignation.options [HullDesignation.value].text];
        design.ArmorLayers     = ArmorThickness;
        design.CrewMin         = ReqCrew;
        design.CrewBerths      = Quarters;
        design.mass            = Mass;
        design.ArmorType       = ArmorType;
        foreach (ShipComponents c in Components)
        {
            int number;
            if (AddedComponents.TryGetValue(c, out number))
            {
                for (int i = 0; i < number; i++)
                {
                    ShipComponents comp = new ShipComponents();
                    comp = c.CloneProperties();
                    Debug.Log("Original " + c.Name);
                    Debug.Log("Clone " + comp.Name);
                    design.Components.Add(comp);
                }
            }
        }
        design.SetupDAC();
        design.CalculateCost();
//		design.Output ();
    }
    //Creates the actual strategic ship
    public void CompleteShip(ShipDesign design)
    {
        StrategicShip  s = new StrategicShip(design, empire);
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 4, empire, "STARSHIP CONSTRUCTED", string.Format("{0} has <color=green>finished construction</color> of a <color=silver>{1}</color>-Class {2}, the {3}.", ShipYardName, s.DesignClass.DesignName, s.DesignClass.HullDesignation.HullType, s.ShipName));

        DockedShips.Add(s);
        //TODO actually make the ship reference for the fleet list.  TODO is this still necessary?
    }
    protected virtual void DeleteShipDesign(ShipDesign design)
    {
        design.Deleted = true;

        if (selectedShipHull != null)
        {
            BuildShipDesigns(selectedShipHull);
        }
    }
Beispiel #16
0
        public static Entity CreateShip(ShipDesign shipDesign, Entity ownerFaction, Entity parent, StarSystem starsys, string shipName = null)
        {
            Vector3 position           = parent.GetDataBlob <PositionDB>().AbsolutePosition_m;
            var     distanceFromParent = parent.GetDataBlob <MassVolumeDB>().RadiusInM * 2;

            position.X += distanceFromParent;

            return(CreateShip(shipDesign, ownerFaction, position, parent, starsys, shipName));
        }
Beispiel #17
0
 public StrategicShip(ShipDesign template, Empire emp)
 {
     Setup(template);
     ShipName = emp.GetName(this);
     Emp      = emp;
     Faction  = emp.Faction;
     Empire.AllLocations.Add(this);
     Emp.Ships.Add(this);
     ShipConstructor();
 }
    public DesignListEntry(Rect rect, ShipDesign design, ButtonPress callback, DeletePress deleteCall, GameManager gameController)
    {
        Design         = design;
        buttonCallBack = callback;
        deleteCallBack = deleteCall;

        ButtonActiveStyle = gameController.SquareButtonGreenStyle;

        selectRect = new Rect(rect.x, rect.y, rect.width - rect.height, rect.height);
        DeleteRect = new Rect(selectRect.xMax, rect.y, rect.width - selectRect.width, rect.height);
    }
Beispiel #19
0
        /// <summary>
        /// Calculate weapon accuracy. For beam weapons, this is 100%.
        ///
        /// For missiles, the chance to hit is based on the base accuracy, the computers
        /// on the ship and the enemy jammers.
        /// </summary>
        /// <param name="ship">Attacking ship.</param>
        /// <param name="weapon">Firing weapon.</param>
        /// <param name="target">Ship being fired on.</param>
        /// <returns>Chance that weapon will hit.</returns>
        private double CalculateWeaponAccuracy(ShipDesign ship, Weapon weapon, ShipDesign target)
        {
            double weaponAccuracy = weapon.Accuracy;

            if (weapon.IsMissile)
            {
                // TODO (priority 6) - computers and jammer stuff needs to go here *************
            }

            return(weaponAccuracy);
        }
Beispiel #20
0
 public static void AddToDesignsByHullDictionary(ShipDesign s)
 {
     if (DesignsByHullDictionary.ContainsKey(s.Hull))
     {
         DesignsByHullDictionary[s.Hull].AddExclusive(s);
     }
     else
     {
         DesignsByHullDictionary.Add(s.Hull, new List <ShipDesign>());
         DesignsByHullDictionary[s.Hull].AddExclusive(s);
     }
 }
Beispiel #21
0
 void Build()
 {
     if (design != null)
     {
         buildLeft -= Buildrate;
         if (buildLeft < 0)
         {
             Empire.CreateEntity(Location, design);
             design       = null;
             ColonyAction = ColonyAction.Mining;
         }
     }
 }
Beispiel #22
0
    public bool BuildShip(ShipDesign design)
    {
        if (ColonyAction != ColonyAction.Building && Empire.Resouces > design.Cost)
        {
            ColonyAction     = ColonyAction.Building;
            this.design      = design;
            buildLeft        = (design.BaseComponents.Count * 10) + design.MaxHp;
            Empire.Resouces -= design.Cost;
            return(true);
        }

        return(false);
    }
Beispiel #23
0
        /// <summary>
        /// Create a new ship or starbase at the specified location. Starbases are
        /// handled just like ships except that they cannot move.
        /// </summary>
        /// <param name="design">A ShipDesign to be constructed.</param>
        /// <param name="star">The star system producing the ship.</param>
        private void CreateShips(ShipDesign design, Star star, int countToBuild)
        {
            EmpireData empire = serverState.AllEmpires[star.Owner];

            ShipToken token = new ShipToken(design, countToBuild);

            Fleet fleet = new Fleet(token, star, empire.GetNextFleetKey());

            fleet.Name          = design.Name + " #" + fleet.Id;
            fleet.FuelAvailable = fleet.TotalFuelCapacity;

            Message message = new Message();

            message.Audience = star.Owner;
            message.Text     = star.Name + " has produced " + countToBuild + " new " + design.Name;
            // message.Event = fleet; // will not be persisted unless the Type is implemented.
            // message.Type = "Fleet"; // TODO (priority 5) - need to add a fleet type message so it can save/load.
            serverState.AllMessages.Add(message);

            // Add the fleet to the state data so it can be tracked.
            serverState.AllEmpires[fleet.Owner].AddOrUpdateFleet(fleet);

            if (design.Type == ItemType.Starbase)
            {
                if (star.Starbase != null)
                {
                    // Old starbases are not scrapped. Instead, the reduced
                    // upgrade cost should have already been factored when first
                    // queuing the "upgrade", so the old SB is just
                    // discarded and replaced at this point. -Aeglos 2 Aug 11
                    star.Starbase = null;
                    // waypointTasks.Scrap(star.Starbase, star, false);
                }

                star.Starbase = fleet;
                fleet.Type    = ItemType.Starbase;
                fleet.Name    = star.Name + " " + fleet.Type;
                fleet.InOrbit = star;

                if (empire.Race.HasTrait("ISB"))
                {
                    fleet.Cloaked = 20;
                }
            }
            else
            {
                fleet.InOrbit = star;
            }
        }
Beispiel #24
0
        public static Entity CreateShip(ShipDesign shipDesign, Entity ownerFaction, Entity parent, double angleRad, string shipName = null)
        {
            Vector3 position = parent.GetDataBlob <PositionDB>().AbsolutePosition_m;

            var distanceFromParent = parent.GetDataBlob <MassVolumeDB>().RadiusInM * 2;

            var x = distanceFromParent * Math.Cos(angleRad);
            var y = distanceFromParent * Math.Sin(angleRad);

            var pos = new Vector3(position.X + x, position.Y + y, 0);

            StarSystem starsys = (StarSystem)parent.Manager;

            return(CreateShip(shipDesign, ownerFaction, pos, parent, starsys, shipName));
        }
Beispiel #25
0
 void BuildFleets(IEnumerable <Fleet> fleets)
 {
     foreach (var guard in fleets)
     {
         var colony = Colonies.FirstOrDefault(x => x.Location == guard.HomeBase);
         var design = PickWarshipDesign();
         if (Resouces < design.Cost)
         {
             savingFor    = design;
             savingTarget = colony;
             return;
         }
         colony.BuildShip(design);
     }
 }
Beispiel #26
0
        /// <summary>
        /// Load: initializing constructor to read in an empire report from an XmlNode (from a saved file).
        /// </summary>
        /// <param name="node">An XmlNode representing an Empire report.</param>
        public EmpireIntel(XmlNode node)
        {
            while (node != null)
            {
                try
                {
                    switch (node.Name.ToLower())
                    {
                    case "empireintel":
                        node = node.FirstChild;
                        continue;

                    case "racename":
                        RaceName = node.FirstChild.Value;
                        break;

                    case "id":
                        Id = ushort.Parse(node.FirstChild.Value, System.Globalization.NumberStyles.HexNumber);
                        break;

                    case "relation":
                        Relation = (PlayerRelation)Enum.Parse(typeof(PlayerRelation), node.FirstChild.Value);
                        break;

                    case "raceicon":
                        Icon = new RaceIcon(node);
                        break;

                    case "enemydesigns":
                        XmlNode subNode = node.FirstChild;
                        while (subNode != null)
                        {
                            ShipDesign design = new ShipDesign(subNode);
                            Designs.Add(design.Key, design);
                            subNode = subNode.NextSibling;
                        }
                        break;
                    }
                }
                catch (Exception e)
                {
                    Report.FatalError(e.Message + "\n Details: \n" + e);
                }

                node = node.NextSibling;
            }
        }
Beispiel #27
0
    public ShipDesign designShip(TechHull hull, Player player)
    {
        ShipDesign design = new ShipDesign(hull.getName(), hull);

        foreach (ShipDesignSlot slot in design.getSlots())
        {
            HullSlotType[] types = slot.getHullSlot().getTypes();

            if (types.Contains(HullSlotType.Engine))
            {
                design.assignSlot(slot, player.getTechs().getBestEngine(), slot.getQuantity());
            }
            else if (types.Contains(HullSlotType.Scanner))
            {
                design.assignSlot(slot, player.getTechs().getBestScanner(), slot.getQuantity());
            }
            else if (types.Contains(HullSlotType.Shield))
            {
                design.assignSlot(slot, player.getTechs().getBestShield(), slot.getQuantity());
            }
            else if (types.Contains(HullSlotType.Armor))
            {
                design.assignSlot(slot, player.getTechs().getBestArmor(), slot.getQuantity());
            }
            else if (types.Contains(HullSlotType.Weapon))
            {
                design.assignSlot(slot, player.getTechs().getBestTorpedo(), slot.getQuantity());
            }
            else if (types.Contains(HullSlotType.Mechanical))
            {
                // if this is a colony ship, put the colonization module in the mechanical slot
                if (hull.getName().Equals("Colony Ship"))
                {
                    design.assignSlot(slot, StaticTechStore.getInstance().getHullComponent("Colonization Module"), slot.getQuantity());
                }
                else
                {
                    design.assignSlot(slot, StaticTechStore.getInstance().getHullComponent("Fuel Tank"), slot.getQuantity());
                }
            }
        }
        design.computeAggregate(player);
        initShipDesign(design);

        return(design);
    }
Beispiel #28
0
        /// <Summary>
        /// Count the number of ships based on a specific design
        /// </Summary>
        /// <param name="design">The design to count instances of.</param>
        /// <returns>The number of ships of the given design that have been built.</returns>
        private int CountDesigns(ShipDesign design)
        {
            int quantity = 0;

            foreach (Fleet fleet in clientState.EmpireState.OwnedFleets.Values)
            {
                foreach (ShipToken token in fleet.Composition.Values)
                {
                    if (token.Design.Key == design.Key)
                    {
                        quantity++;
                    }
                }
            }

            return(quantity);
        }
Beispiel #29
0
        public static Entity CreateShip(ShipDesign shipDesign, Entity ownerFaction, Vector3 position, Entity parent, StarSystem starsys, string shipName = null)
        {
            List <BaseDataBlob> dataBlobs = new List <BaseDataBlob>();

            var shipinfo = new ShipInfoDB();

            dataBlobs.Add(shipinfo);
            var mvdb = MassVolumeDB.NewFromMassAndVolume(shipDesign.Mass, shipDesign.Volume);

            dataBlobs.Add(mvdb);
            PositionDB posdb = new PositionDB(Distance.MToAU(position), starsys.Guid, parent);

            dataBlobs.Add(posdb);
            EntityDamageProfileDB damagedb = (EntityDamageProfileDB)shipDesign.DamageProfileDB.Clone();

            dataBlobs.Add(damagedb);
            ComponentInstancesDB compInstances = new ComponentInstancesDB();

            dataBlobs.Add(compInstances);
            OrderableDB ordable = new OrderableDB();

            dataBlobs.Add(ordable);
            var ship = Entity.Create(starsys, ownerFaction.Guid, dataBlobs);

            //some DB's need tobe created after the entity.
            var namedb = new NameDB(ship.Guid.ToString());

            namedb.SetName(ownerFaction.Guid, shipName);
            OrbitDB orbit = OrbitDB.FromPosition(parent, ship, starsys.ManagerSubpulses.StarSysDateTime);

            ship.SetDataBlob(namedb);
            ship.SetDataBlob(orbit);

            foreach (var item in shipDesign.Components)
            {
                EntityManipulation.AddComponentToEntity(ship, item.design, item.count);
            }

            if (ship.HasDataBlob <NewtonThrustAbilityDB>() && ship.HasDataBlob <CargoStorageDB>())
            {
                NewtonionMovementProcessor.CalcDeltaV(ship);
            }

            return(ship);
        }
Beispiel #30
0
        /// <Summary> Add a starbase to the production queue. </Summary>
        /// <remarks>
        /// Starbases are special in that there
        /// can ony ever be one in the production queue, no matter how many he tries to
        /// add.
        /// FIXME (priority 6) - Dan - What if I want to build a small base first, then add a larger base latter. I can queue two different base designs in Stars!
        /// </remarks>
        private void AddStarbase(ShipDesign design)
        {
            // First run through the production queue to see if there is already a
            // starbase there. If there is remove it.
            int i = 0;

            for (i = 0; i < designList.Items.Count; i++)
            {
                if (designList.Items[i].Text == design.Name)
                {
                    break;
                }
            }

            designList.Items.RemoveAt(i);

            //AddProduction(design, 1);
        }