Esempio n. 1
0
        /// <summary>
        /// Create and effect with the specified Force and Type
        /// </summary>
        /// <param name="force"></param>
        /// <param name="type"></param>
        public Effect(EForce effectForce, EType effectType)
            : this()
        {
            this.Force         = effectForce;
            this.Type          = effectType;
            this.Direction     = EDirection.North;
            this.TriggerButton = -1;
            this.ReplayLength  = INFINITE_TIME;
            this._handle       = -1;

            switch (effectForce)
            {
            case EForce.ConstantForce:
                this._forceEffect = new ConstantEffect();
                break;

            case EForce.RampForce:
                this._forceEffect = new RampEffect();
                break;

            case EForce.PeriodicForce:
                this._forceEffect = new PeriodicEffect();
                break;

            case EForce.ConditionalForce:
                this._forceEffect = new ConditionalEffect();
                break;

            default:
                throw new ArgumentOutOfRangeException("effectForce value not supported.");
            }
        }
Esempio n. 2
0
        public static ERelation GetRelation(EForce a, EForce b)
        {
            if (a == EForce.NONE ||
                b == EForce.NONE)
            {
                return(ERelation.NONE);
            }

            if (a == b)
            {
                return(ERelation.ALLY);
            }
            else
            {
                return(ERelation.ENEMY);
            }
        }