public override void Undo() { for (int i = changes.Count - 1; i >= 0; i--) { ComboChange c = changes[i]; Level.Combos[c.index].SetByte(c.tile, c.oldValue); } }
public override void Do() { for (int i = 0; i < changes.Count; i++) { ComboChange c = changes[i]; Level.Combos[c.index].SetByte(c.tile, c.newValue); } }
public override bool Equals(object obj) { if (!(obj is ComboChange)) { return(false); } ComboChange c = (ComboChange)obj; return(c.index == index && c.newValue == newValue && c.oldValue == oldValue && c.tile == tile); }
public void UpdateCombo(ComboChange change) { lock (ComboLock) { switch (change) { case ComboChange.Add: Combo++; if (Combo > MaxCombo) { MaxCombo = Combo; } break; case ComboChange.Break: Combo = 0; break; } if (Combo == 0) { CurrentComboVelo = 0; } else { var veloDecider = Beats.Count / Combo; switch (veloDecider) { case 5: CurrentComboVelo = 37; break; case 4: CurrentComboVelo = 45; break; case 3: CurrentComboVelo = 53; break; case 2: CurrentComboVelo = 118; break; case 1: CurrentComboVelo = 12; break; default: CurrentComboVelo = 0; break; } } } }