Пример #1
0
        public void AssignCaptainToShip(CaptainObject captain)
        {
            this.captainObject = captain;

            for (int i = 0; i < this.upgradeObjects.Count; i++)
            {
                if (this.upgradeObjects[i] != null)
                {
                    if (this.upgradeObjects[i].type == "Talent")
                    {
                        this.upgradeObjects.Remove(this.upgradeObjects[i]);
                        i--;
                    }
                }
            }

            for(int t = 0; t < this.captainObject.talent; t++)
            {
                this.upgradeObjects.Add(CreateEmptyUpgradeObject("Talent"));
            }
        }
Пример #2
0
 public void CreateEmptyCaptainObject()
 {
     this.captainObject = new CaptainObject();
 }
Пример #3
0
        private void CreateNewCaptain(string selectedItem, string selectedId)
        {
            for (int i = 0; i < this.captainNodeList.Count; i++)
            {
                XmlNode node = this.captainNodeList[i];
                if (node["Id"].InnerText == selectedId)
                {
                    CaptainObject captain = new CaptainObject(node);

                    //UNIQUE CAPTAIN CHECK
                    if (captain.uniqueFlag)
                    {
                        for (int j = 0; j < this.shipObjects.Count; j++)
                        {
                            if (this.shipObjects[j].captainObject != null)
                            {
                                if (this.shipObjects[j].captainObject.title == captain.title)
                                {
                                    MessageBox.Show("Unique captain already exists in Squadron List.", "Error");
                                    return;
                                }
                            }
                        }
                    }

                    this.shipObjects[this.activeListBoxValue].AssignCaptainToShip(captain);

                    this.pointCounter = new PointCounter();
                    this.pointCounter.RecalculatePointTotals(this.shipObjects, this.resourceManager.resourceObjects);
                    this.form.RefreshSelectedObjectsListBox();
                    return;
                }
            }
        }