コード例 #1
0
        public ItemProbability GetMatchRaceProbability(int setIndex, ItemProbabilityMatchRaceCondition condition)
        {
            setIndex = ItemProbabilities.ConvertSetIndex(setIndex);
            int offset = setIndex * LapRankCount + (int)condition;

            return(this.itemProbabilities[offset]);
        }
コード例 #2
0
        public ItemProbability GetGrandprixProbability(int setIndex, ItemProbabilityGrandprixCondition condition)
        {
            setIndex = ItemProbabilities.ConvertSetIndex(setIndex);
            int offset = setIndex * LapRankCount + (int)condition + (LapRankCount * SetCount);

            return(this.itemProbabilities[offset]);
        }
コード例 #3
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;
            }
        }
コード例 #4
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);
            }
        }