コード例 #1
0
        public static void UpdateCooldowns(this UnitEntityData unit, UnitCommand command)
        {
            if (!command.IsIgnoreCooldown)
            {
                UnitCombatState.Cooldowns cooldown = unit.CombatState.Cooldown;
                switch (command.Type)
                {
                case UnitCommand.CommandType.Free:
                    break;

                case UnitCommand.CommandType.Move:
                    cooldown.MoveAction += TIME_MOVE_ACTION;
                    break;

                case UnitCommand.CommandType.Standard:
                    cooldown.StandardAction += TIME_STANDARD_ACTION;
                    if (command.IsFullRoundAction())
                    {
                        cooldown.MoveAction += TIME_MOVE_ACTION;
                    }
                    break;

                case UnitCommand.CommandType.Swift:
                    cooldown.SwiftAction += TIME_SWIFT_ACTION;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }