Beispiel #1
0
        public ItemProbabilities(byte[] data)
        {
            this.itemProbabilities = new ItemProbability[ItemProbabilities.Count];

            for (int i = 0; i < ItemProbabilities.Count; i++)
            {
                byte[] itemData = ItemProbabilities.GetItemData(data, i);
                this.itemProbabilities[i] = new ItemProbability(itemData);
                this.itemProbabilities[i].PropertyChanged += this.OnPropertyChanged;
            }
        }
Beispiel #2
0
        public void SetBytes(byte[] data)
        {
            if (data.Length != ItemProbabilities.Size)
            {
                throw new ArgumentException($"Item probabilities data should have a size of {Size} bytes. Actual: {data.Length} bytes.", nameof(data));
            }

            for (int i = 0; i < ItemProbabilities.Count; i++)
            {
                byte[] itemData = ItemProbabilities.GetItemData(data, i);
                this.itemProbabilities[i].SetBytes(itemData);
            }
        }