DataHolder.Init C# (CSharp) Method

Init() public method

public Init ( ) : void
return void
    public void Init()
    {
        // first init languages
        languages = new LanguageData();

        statusValues = new  StatusValueData();
        elements = new  ElementData();
        races = new RaceData();
        sizes = new SizeData();
        areaNames = new AreaNameData();
        armors = new ArmorData();
        cameraPositions = new  CameraPositionData();
        attacks = new BaseAttackData();
        characters = new  CharacterData();
        classes = new  ClassData();
        colors = new  ColorData();
        dialoguePositions = new  DialoguePositionData();
        battleAIs = new  BattleAIData();
        enemies = new  EnemyData();
        equipParts = new  EquipmentPartData();
        formulas = new  FormulaData();
        gameSettings = new  GameSettingsData();
        items = new  ItemData();
        itemTypes = new  ItemTypeData();
        loadSaveHUD = new LoadSaveHUDData();
        mainMenu = new MainMenuData();
        skillTypes = new  SkillTypeData();
        effects = new  StatusEffectData();
        skills = new  SkillData();
        weapons = new  WeaponData();
        music = new MusicData();
        huds = new HUDData();
        recipes = new ItemRecipeData();
        fonts = new FontData();
        globalEvents = new GlobalEventData();
        teleports = new TeleportData();
        difficulties = new DifficultyData();

        // battle system
        battleAnimations = new BattleAnimationData();
        battleSystem = new BattleSystemData();
    }

Usage Example

Example #1
0
        private async void Totaux_Loaded(object sender, RoutedEventArgs e)
        {
            observableCollection = new ObservableCollection <Prod>();
            DataHolder           = new DataHolder();
            await DataHolder.Init();

            foreach (var data in DataHolder.Products)
            {
                observableCollection.Add(new Prod()
                {
                    Product = data, Quant = 0, SlicedQuant = 0
                });
            }
            foreach (var client in DataHolder.Clients)
            {
                foreach (var pr in client.Products)
                {
                    //https://stackoverflow.com/questions/6781192/how-do-i-update-a-single-item-in-an-observablecollection-class
                    var prod = observableCollection.First(tmp => tmp.Product.Name == pr.Product.Name);
                    var idx  = observableCollection.IndexOf(prod);
                    prod.Quant += pr.Quantity;
                    if (pr.Sliced)
                    {
                        prod.SlicedQuant += pr.Quantity;
                    }
                    observableCollection[idx] = prod;
                }
            }
            Total.ItemsSource = observableCollection;
        }
All Usage Examples Of DataHolder::Init