Example #1
0
 public void DrawItemList()
 {
     List<string> items = partyData.Inventory;
     itemsInventory = new List<ItemData>();
     for (int i = 0; i < items.Count; i++)
     {
         ItemData item = itemDatabase.GetItemData(items[i]);
         itemsInventory.Add(item);
         inventoryListDrawer.DrawItemList(i, item.ItemIcon, item.ItemName);
     }
     inventoryListDrawer.SetItemCount(items.Count);
     if (itemsInventory.Count != 0)
         DrawItemPreview(0);
 }
Example #2
0
 public void DrawItemList()
 {
     List<string> items = new List<string>(partyData.Inventory.Count);
     for (int i = 0; i < partyData.Inventory.Count; i++)
     {
         items.Add(partyData.Inventory[i]);
     }
     for (int i = 0; i < partyData.CharacterEquipement.Count; i++)
     {
         items.AddRange(partyData.CharacterEquipement[i].GetArmors());
     }
     itemsInventory = new List<ItemData>();
     for (int i = 0; i < items.Count; i++)
     {
         ItemData item = itemDatabase.GetItemData(items[i]);
         itemsInventory.Add(item);
         inventoryListDrawer.DrawItemList(i, item.ItemIcon, item.ItemName);
     }
     inventoryListDrawer.SetItemCount(items.Count);
     if (itemsInventory.Count != 0)
         DrawItemPreview(0);
 }
Example #3
0
        // On utilise les valeurs qu'on a sauver pour re générer les joueurs 
        // Bon le Load c'est un peu n'importe quoi ça fait beaucoup de chose, à refactor peut etre
        public void LoadPartyData(PlayerDatabase database, GameVariableDatabase variableDatabase, GameVariableDatabase chestDatabase, ItemDatabase itemDatabase)
        {
            variableDatabase.LoadVariable(gameVariables);
            chestDatabase.LoadVariable(chestVariable);
            characterStatControllers.Clear();
            characterGrowths.Clear();
            characterEquipement.Clear();
            for (int i = 0; i < characterSavesData.Count; i++)
            {
                PlayerData playerData = database.GetPlayerData(characterSavesData[i].playerDataID);
                characterStatControllers.Add(new CharacterStatController(playerData.CharacterData));
                characterGrowths.Add(new CharacterGrowthController(playerData.CharacterGrowth, characterStatControllers[i]));

                // Convertit les string du json en ArmorData
                List<ArmorData> res = new List<ArmorData>(characterSavesData[i].armorEquipped.Count);
                for (int j = 0; j < characterSavesData[i].armorEquipped.Count; j++)
                {
                    res.Add((ArmorData) itemDatabase.GetItemData(characterSavesData[i].armorEquipped[j]));
                }
                characterEquipement.Add(new CharacterEquipementController(playerData.WeaponEquipped, res, playerData.WeaponLevels, characterSavesData[i].playerExperience, characterStatControllers[i], characterGrowths[i]));

            }
            partyInitialized = new PartyInitialized();
        }