public ItemProbability GetMatchRaceProbability(int setIndex, ItemProbabilityMatchRaceCondition condition) { setIndex = ItemProbabilities.ConvertSetIndex(setIndex); int offset = setIndex * LapRankCount + (int)condition; return(this.itemProbabilities[offset]); }
public ItemProbability GetGrandprixProbability(int setIndex, ItemProbabilityGrandprixCondition condition) { setIndex = ItemProbabilities.ConvertSetIndex(setIndex); int offset = setIndex * LapRankCount + (int)condition + (LapRankCount * SetCount); return(this.itemProbabilities[offset]); }
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; } }
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); } }