/// <summary> /// Whether or not an item was purchased, on average, during the late stage of the game. /// </summary> public static bool IsLatePurchase(ItemPurchaseTrackerData tracker) { return !IsStartPurchase(tracker) && !IsEarlyPurchase(tracker) && !IsMidPurchase(tracker); }
public ItemPurchaseTrackerData Clone() { var tracker = new ItemPurchaseTrackerData(this.ItemId); tracker.CopyFrom(this); return(tracker); }
/// <summary> /// Gets the game stage a purchase took place in. /// </summary> public static GameStage GetGameStage(ItemPurchaseTrackerData tracker) { return IsStartPurchase(tracker) ? GameStage.Start : IsEarlyPurchase(tracker) ? GameStage.Early : IsMidPurchase(tracker) ? GameStage.Mid : GameStage.Late; }
public ItemPurchaseStats(ItemPurchaseTrackerData tracker, long totalMatches) : base(tracker.ItemId) { CopyFrom(tracker); Percentage = (float)this.Count / (float)totalMatches; TotalMatches = totalMatches; // Calculate build path percentages BuiltIntoPercentage = BuiltInto.ToDictionary(kvp => kvp.Key, kvp => (float)kvp.Value / (this.Count)); FinalBuildItemPercentage = FinalBuildItem.ToDictionary(kvp => kvp.Key, kvp => (float)kvp.Value / (this.Count)); }
protected void CopyFrom(ItemPurchaseTrackerData other) { ItemId = other.ItemId; Number = other.Number; Count = other.Count; AveragePurchaseTimeSeconds = other.AveragePurchaseTimeSeconds; Kills = other.Kills; TowerKills = other.TowerKills; InnerTowerKills = other.InnerTowerKills; BaseTowerKills = other.BaseTowerKills; BuiltInto = new Dictionary <ItemPurchaseKey, long>(other.BuiltInto); FinalBuildItem = new Dictionary <ItemPurchaseKey, long>(other.FinalBuildItem); }
public void Combine(ItemPurchaseTrackerData other) { if (other.ItemId != ItemId || other.Number != Number) { return; } double totalCount = Count + other.Count; AveragePurchaseTimeSeconds = (AveragePurchaseTimeSeconds * ((double)Count / totalCount)) + (other.AveragePurchaseTimeSeconds * ((double)other.Count / totalCount)); Count += other.Count; Kills += other.Kills; TowerKills += other.TowerKills; InnerTowerKills += other.InnerTowerKills; BaseTowerKills += other.BaseTowerKills; }
public ItemPurchaseKey(ItemPurchaseTrackerData tracker) { ItemId = tracker.ItemId; Number = tracker.Number; }
protected void CopyFrom(ItemPurchaseTrackerData other) { ItemId = other.ItemId; Number = other.Number; Count = other.Count; AveragePurchaseTimeSeconds = other.AveragePurchaseTimeSeconds; Kills = other.Kills; TowerKills = other.TowerKills; InnerTowerKills = other.InnerTowerKills; BaseTowerKills = other.BaseTowerKills; BuiltInto = new Dictionary<ItemPurchaseKey, long>(other.BuiltInto); FinalBuildItem = new Dictionary<ItemPurchaseKey, long>(other.FinalBuildItem); }
public void Combine(ItemPurchaseTrackerData other) { if (other.ItemId != ItemId || other.Number != Number) return; double totalCount = Count + other.Count; AveragePurchaseTimeSeconds = (AveragePurchaseTimeSeconds * ((double)Count / totalCount)) + (other.AveragePurchaseTimeSeconds * ((double)other.Count / totalCount)); Count += other.Count; Kills += other.Kills; TowerKills += other.TowerKills; InnerTowerKills += other.InnerTowerKills; BaseTowerKills += other.BaseTowerKills; }
public ItemPurchaseTrackerData Clone() { var tracker = new ItemPurchaseTrackerData(this.ItemId); tracker.CopyFrom(this); return tracker; }
/// <summary> /// Whether or not an item was purchased, on average, during the mid stage of the game. /// </summary> public static bool IsMidPurchase(ItemPurchaseTrackerData tracker) { return !IsStartPurchase(tracker) && !IsEarlyPurchase(tracker) && tracker.AverageInnerTowerKills < 2.5f && // Getting too close to 3 puts a lot of items into the mid-game bucket tracker.AverageBaseTowerKills < 1.0f; }
/// <summary> /// Whether or not an item was purchased, on average, during the early stage of the game. /// </summary> public static bool IsEarlyPurchase(ItemPurchaseTrackerData tracker) { return !IsStartPurchase(tracker) && tracker.AverageTowerKills < 1.0f; }
/// <summary> /// Whether or not an item was purchased, on average, during the start of the game. /// </summary> public static bool IsStartPurchase(ItemPurchaseTrackerData tracker) { return tracker.AveragePurchaseTimeSeconds <= 90.0 && tracker.AverageKills < 1.0f && tracker.AverageTowerKills < 1.0; }