コード例 #1
0
ファイル: W3dModelDraw.cs プロジェクト: Nostritius/OpenSAGE
        public W3dModelDraw(W3dModelDrawModuleData data)
        {
            _data = data;

            _conditionStates = new List <ModelConditionState>();

            if (data.DefaultConditionState != null)
            {
                _defaultConditionState = data.DefaultConditionState;
            }

            foreach (var conditionState in data.ConditionStates)
            {
                _conditionStates.Add(conditionState);
            }

            if (_defaultConditionState == null)
            {
                _defaultConditionState = _conditionStates.Find(x => !x.ConditionFlags.AnyBitSet);

                if (_defaultConditionState != null)
                {
                    _conditionStates.Remove(_defaultConditionState);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }
        }
コード例 #2
0
        internal W3dModelDraw(
            W3dModelDrawModuleData data,
            Drawable drawable,
            GameContext context)
        {
            _data    = data;
            Drawable = drawable;
            _context = context;

            _conditionStates = new List <IConditionState>();

            if (data.DefaultConditionState != null)
            {
                _defaultConditionState = data.DefaultConditionState;
            }

            foreach (var conditionState in data.ConditionStates)
            {
                _conditionStates.Add(conditionState);
            }

            if (_defaultConditionState == null)
            {
                _defaultConditionState = (ModelConditionState)_conditionStates.Find(x => !x.ConditionFlags.AnyBitSet);

                if (_defaultConditionState != null)
                {
                    _conditionStates.Remove(_defaultConditionState);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }

            _cachedModelDrawConditionStates = new Dictionary <ModelConditionState, W3dModelDrawConditionState>();

            SetActiveConditionState(_defaultConditionState, context.Random);

            _animationStates = new List <IConditionState>();

            if (data.IdleAnimationState != null)
            {
                _idleAnimationState = data.IdleAnimationState;
            }

            foreach (var animationState in data.AnimationStates)
            {
                _animationStates.Add(animationState);
            }

            _generalsTransitionStates = data.GeneralsTransitionStates;
            _bfmeTransitionStates     = data.BfmeTransitionStates;

            _unknownSomething = new List <W3dModelDrawSomething> [3];
            for (var i = 0; i < _unknownSomething.Length; i++)
            {
                _unknownSomething[i] = new List <W3dModelDrawSomething>();
            }
        }
コード例 #3
0
ファイル: W3dModelDraw.cs プロジェクト: lowsound42/OpenSAGE
        internal W3dModelDraw(
            W3dModelDrawModuleData data,
            GameObject gameObject,
            GameContext context)
        {
            _data      = data;
            GameObject = gameObject;
            _context   = context;

            _conditionStates = new List <IConditionState>();

            if (data.DefaultConditionState != null)
            {
                _defaultConditionState = data.DefaultConditionState;
            }

            foreach (var conditionState in data.ConditionStates)
            {
                _conditionStates.Add(conditionState);
            }

            if (_defaultConditionState == null)
            {
                _defaultConditionState = (ModelConditionState)_conditionStates.Find(x => !x.ConditionFlags.AnyBitSet);

                if (_defaultConditionState != null)
                {
                    _conditionStates.Remove(_defaultConditionState);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }

            _cachedModelDrawConditionStates = new Dictionary <ModelConditionState, W3dModelDrawConditionState>();

            SetActiveConditionState(_defaultConditionState, context.Random);

            _animationStates = new List <IConditionState>();

            if (data.IdleAnimationState != null)
            {
                _idleAnimationState = data.IdleAnimationState;
            }

            foreach (var animationState in data.AnimationStates)
            {
                _animationStates.Add(animationState);
            }

            _generalsTransitionStates = data.GeneralsTransitionStates;
            _bfmeTransitionStates     = data.BfmeTransitionStates;
        }
コード例 #4
0
ファイル: W3dModelDraw.cs プロジェクト: wu162/OpenSAGE
        internal W3dModelDraw(
            W3dModelDrawModuleData data,
            GameContext context)
        {
            _data    = data;
            _context = context;

            _conditionStates = new List <ModelConditionState>();

            if (data.DefaultConditionState != null)
            {
                _defaultConditionState = data.DefaultConditionState;
            }

            foreach (var conditionState in data.ConditionStates)
            {
                _conditionStates.Add(conditionState);
            }

            if (_defaultConditionState == null)
            {
                _defaultConditionState = _conditionStates.Find(x => !x.ConditionFlags.AnyBitSet);

                if (_defaultConditionState != null)
                {
                    _conditionStates.Remove(_defaultConditionState);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }

            _cachedModelDrawConditionStates = new Dictionary <ModelConditionState, W3dModelDrawConditionState>();

            SetActiveConditionState(_defaultConditionState);

            _animationStates = new List <AnimationState>();

            if (data.IdleAnimationState != null)
            {
                _idleAnimationState = data.IdleAnimationState;
            }

            foreach (var animationState in data.AnimationStates)
            {
                _animationStates.Add(animationState);
            }
        }
コード例 #5
0
        internal W3dModelDraw(
            W3dModelDrawModuleData data,
            Drawable drawable,
            GameContext context)
        {
            _data    = data;
            Drawable = drawable;
            _context = context;

            UpdateConditionState(new BitArray <ModelConditionFlag>(), context.Random);

            _unknownSomething = new List <W3dModelDrawSomething> [3];
            for (var i = 0; i < _unknownSomething.Length; i++)
            {
                _unknownSomething[i] = new List <W3dModelDrawSomething>();
            }
        }