示例#1
0
        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);
                }
            }
        }
示例#2
0
 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;
         }
     }
 }
示例#3
0
        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);
        }
示例#4
0
 public void AppendBuffCommand(BuffCommandInfo cmd, byte Slot)
 {
     CommandInfo[Slot].AddCommandToChain(cmd);
 }
示例#5
0
 public void AddBuffCommand(BuffCommandInfo cmd)
 {
     CommandInfo.Add(cmd);
 }