コード例 #1
0
        public HotkeyObjectAction(Core.Appearances.AppearanceType appearanceType, UseActionTarget actionTarget)
        {
            if (!appearanceType)
            {
                throw new System.ArgumentNullException("HotkeyObjectAction.HotkeyObjectAction: invalid appearance type");
            }

            if (appearanceType.Category != AppearanceCategory.Object)
            {
                throw new System.Exception("HotkeyObjectAction.HotkeyObjectAction: invalid appearance type.");
            }

            AppearanceType = appearanceType;
            ActionTarget   = actionTarget;
        }
コード例 #2
0
        public HotkeyObjectAction(Core.Appearances.AppearanceType appearanceType, UseActionTarget actionTarget)
        {
            if (!appearanceType)
            {
                throw new System.ArgumentNullException("HotkeyObjectAction.HotkeyObjectAction: invalid appearance type");
            }

            if (appearanceType.Category != AppearanceCategory.Object)
            {
                throw new System.Exception("HotkeyObjectAction.HotkeyObjectAction: invalid appearance type.");
            }

            AppearanceType = appearanceType;
            if (AppearanceType.IsMultiUse && actionTarget == UseActionTarget.Auto)
            {
                actionTarget = UseActionTarget.CrossHair;
            }
            else if (!AppearanceType.IsMultiUse && actionTarget != UseActionTarget.Auto)
            {
                actionTarget = UseActionTarget.Auto;
            }

            ActionTarget = actionTarget;
        }