public void AddCommandToChain(BuffCommandInfo slaveCommand) { if (CommandSequence == 0) { if (NextCommand == null) { NextCommand = slaveCommand; slaveCommand.LastCommand = this; } else { NextCommand.AddCommandToChain(slaveCommand); } } else { if (slaveCommand.CommandSequence <= CommandSequence) { LastCommand.NextCommand = slaveCommand; slaveCommand.LastCommand = LastCommand; // Handle chains of commands while (slaveCommand.NextCommand != null) { slaveCommand = slaveCommand.NextCommand; } LastCommand = slaveCommand; slaveCommand.NextCommand = this; } else if (NextCommand == null) { NextCommand = slaveCommand; slaveCommand.LastCommand = this; } else { NextCommand.AddCommandToChain(slaveCommand); } } }
public void DeleteCommand(byte slot, byte seq) { if (seq == 0) { CommandInfo.RemoveAt(slot); } else { BuffCommandInfo toDelete = CommandInfo[slot].GetSubcommand(seq); if (toDelete != null) { toDelete.LastCommand.NextCommand = toDelete.NextCommand; if (toDelete.NextCommand != null) { toDelete.NextCommand.LastCommand = toDelete.LastCommand; toDelete.NextCommand = null; } toDelete.LastCommand = null; } } }
public BuffCommandInfo CloneChain() { BuffCommandInfo cCommandInfo = (BuffCommandInfo)MemberwiseClone(); cCommandInfo.CommandName = (string)CommandName.Clone(); if (DamageInfo != null) { cCommandInfo.DamageInfo = DamageInfo.Clone(); } if (NextCommand != null) { cCommandInfo.NextCommand = NextCommand.CloneChain(); } if (cCommandInfo.NextCommand != null) { cCommandInfo.NextCommand.LastCommand = cCommandInfo; } return(cCommandInfo); }
public void AppendBuffCommand(BuffCommandInfo cmd, byte Slot) { CommandInfo[Slot].AddCommandToChain(cmd); }
public void AddBuffCommand(BuffCommandInfo cmd) { CommandInfo.Add(cmd); }