void AddSorted(ActionMod item) { if (Mods.Count == 0) { Mods.Add(item); return; } if (Mods[Mods.Count - 1].CompareTo(item) <= 0) { Mods.Add(item); return; } if (Mods[0].CompareTo(item) >= 0) { Mods.Insert(0, item); return; } int index = Mods.BinarySearch(item); if (index < 0) { index = ~index; } Mods.Insert(index, item); }
void RegisterEvents() { if (_startCDEvent == null) { _startCDEvent = new ActionMod(0, StartCooldownVisual); } if (_actionUsedEvent == null) { _actionUsedEvent = new ActionMod(0, ActionUsed); } _template.OnComplete.RegisterAction(_startCDEvent); _template.OnStart.RegisterAction(_actionUsedEvent); }
public override void ModifyCharacter(Character character) { _mod = new ActionMod(0, Effect); character.HeavyAttack.OnComplete.RegisterAction(_mod); }
private void TSBtn_Click(object sender, EventArgs e) { ToolStripButton tsbtn = sender as ToolStripButton; if (currentActBtn != tsbtn) { if (currentActBtn != null) currentActBtn.Checked = false; currentActBtn = tsbtn; currentActBtn.Checked = true; } else { currentActBtn.Checked = false; currentActBtn = null; this._ActionMod = ActionMod.None; return; } switch (currentActBtn.Name) { case "btnRect": { this._ActionMod = ActionMod.Rectangle; break; } case "btnCircle": { this._ActionMod = ActionMod.Circle; break; } case "btnArrow": { this._ActionMod = ActionMod.Arrow; break; } case "btnBrush": { this._ActionMod = ActionMod.Brush; break; } case "btnFont": { this._ActionMod = ActionMod.Text; break; } case "btnUndo": { //if (imglist.Count > 1) //{ // this.BackgroundImage = imglist[imglist.Count - 2]; // imglist.RemoveAt(imglist.Count - 1); //} break; } case "btnSave": { finish(true); break; } case "btnCancel": { this.Visible = false; this.Cursor = Cursors.Default; break; } case "btnDone": { finish(); break; } } }
public override void ModifyCharacter(Character character) { _mod = new ActionMod(0, Effect); character.LightAttack.OnStart.RegisterAction(_mod); }
public override void ModifyCharacter(Character character) { _mod = new ActionMod(100, Effect); character.OnActionComplete.RegisterAction(_mod); }
public void UnregisterAction(ActionMod action) { Mods.Remove(action); }
public void RegisterAction(ActionMod action) { AddSorted(action); }