Ejemplo n.º 1
0
        private void AddCharacterItems(CharacterInventory inventory)
        {
            TreeNode inventoryNode = new TreeNode("Complete inventory");

            //CharacterInventoryType type = inventory.GetInventoryById((int)InventoryTypes.Inventory);
            foreach (CharacterInventoryType inventoryType in inventory.InventoryType)
            {
                InventoryTypesComplete tmp = (InventoryTypesComplete)inventoryType.InventoryType;
                TreeNode inventoryTypeNode = new TreeNode(tmp.ToString());
                inventoryTypeNode.ForeColor = Color.Red;

                foreach (CharacterItems item in inventoryType.Items)
                {
                    TreeNode node = CreateItemNode(item);
                    inventoryTypeNode.Nodes.Add(node);
                }

                inventoryNode.Nodes.Add(inventoryTypeNode);
            }

            treeViewSkills.Nodes.Add(inventoryNode);
        }
Ejemplo n.º 2
0
        public CharacterWrapper(UnitObject character, FileManager fileManager)
            : base(character, fileManager)
        {
            itemsTable = fileManager.GetDataTable("ITEMS");

            DataTable players = fileManager.GetDataTable("PLAYERS");
            DataRow[] playerRow = players.Select("code = " + character.UnitCode);

            if (playerRow.Length > 0)
            {
                int playerType = (int)playerRow[0]["unitType"];

                List<int> skillTabs = new List<int>();

                for (int counter = 1; counter < 8; counter++)
                {
                    int skillTab = (int)playerRow[0]["SkillTab" + counter];
                    if (skillTab >= 0)
                    {
                        skillTabs.Add(skillTab);
                    }
                }

                unitType = playerType - 3;

                characterSkills = new CharacterSkills(character, fileManager, skillTabs.ToArray());
            }

            characterClass = GetCharacterClass(character);
            characterGameMode = new CharacterGameMode(character, fileManager);
            characterValues = new CharacterValues(character, fileManager);
            gender = characterClass.ToString().EndsWith("_Male") ? Gender.Male : Gender.Female;
            weaponSlots = new WeaponSlots(character, fileManager);
            characterInventory = new CharacterInventory(character, fileManager);

            if (characterClass == CharacterClass.Engineer_Male || characterClass == CharacterClass.Engineer_Female)
            {
                //drone = new EngineerDrone(character, fileManager);
            }
        }