예제 #1
0
        public void AddCommandToChain(AbilityCommandInfo 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;
                    LastCommand = slaveCommand;
                    slaveCommand.NextCommand = this;
                }

                else if (NextCommand == null)
                {
                    NextCommand = slaveCommand;
                    slaveCommand.LastCommand = this;
                }
                else
                {
                    NextCommand.AddCommandToChain(slaveCommand);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Adds a command to the command sequence, linking the previous command's damage information.
        /// </summary>
        public void AddCommandToChainWithDamage(AbilityCommandInfo slaveCommand)
        {
            if (CommandSequence == 0)
            {
                if (NextCommand == null || slaveCommand.CommandSequence == CommandSequence)
                {
                    NextCommand = slaveCommand;
                    slaveCommand.LastCommand = this;
                    if (DamageInfo != null)
                    {
                        slaveCommand.DamageInfo = DamageInfo.Clone();
                    }
                    else
                    {
                        slaveCommand.DamageInfo = LastCommand.DamageInfo.Clone();
                    }
                }
                else
                {
                    NextCommand.AddCommandToChainWithDamage(slaveCommand);
                }
            }
            else
            {
                if (slaveCommand.CommandSequence < CommandSequence)
                {
                    LastCommand.NextCommand  = slaveCommand;
                    slaveCommand.LastCommand = LastCommand;
                    LastCommand = slaveCommand;
                    slaveCommand.NextCommand = this;

                    if (slaveCommand.LastCommand.DamageInfo != null)
                    {
                        slaveCommand.DamageInfo = slaveCommand.LastCommand.DamageInfo.Clone();
                    }
                }

                else if (NextCommand == null)
                {
                    NextCommand = slaveCommand;
                    slaveCommand.LastCommand = this;

                    if (DamageInfo != null)
                    {
                        slaveCommand.DamageInfo = DamageInfo.Clone();
                    }
                    else
                    {
                        slaveCommand.DamageInfo = LastCommand.DamageInfo.Clone();
                    }
                }
                else
                {
                    NextCommand.AddCommandToChainWithDamage(slaveCommand);
                }
            }
        }
예제 #3
0
 public void AppendAbilityCommand(AbilityCommandInfo cmd, byte slot)
 {
     try
     {
         CommandInfo[slot].AddCommandToChain(cmd);
     }
     catch (Exception e)
     {
         System.Console.WriteLine(e);
         throw;
     }
 }
예제 #4
0
        public AbilityCommandInfo Clone(Unit caster)
        {
            AbilityCommandInfo cCommandInfo = (AbilityCommandInfo)MemberwiseClone();

            cCommandInfo.CommandName = (string)CommandName.Clone();

            cCommandInfo.LastCommand = null;
            cCommandInfo.NextCommand = null;

            if (DamageInfo != null)
            {
                cCommandInfo.DamageInfo = DamageInfo.Clone(caster);
            }

            return(cCommandInfo);
        }
예제 #5
0
 public void DeleteCommand(byte slot, byte seq)
 {
     if (seq == 0)
     {
         CommandInfo.RemoveAt(slot);
     }
     else
     {
         AbilityCommandInfo 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;
         }
     }
 }
예제 #6
0
 public void AppendAbilityCommandWithDamage(AbilityCommandInfo cmd, byte slot)
 {
     CommandInfo[slot].AddCommandToChainWithDamage(cmd);
 }
예제 #7
0
 public void AddAbilityCommand(AbilityCommandInfo cmd)
 {
     CommandInfo.Add(cmd);
 }