private void SetDefaultRestrictions()
 {
     // restriction cache
     _PositionRestriction     = PositionRestrictions.None;
     _Scalable                = true;
     _RotationStepRestriction = 0;
     _PositionGridRestriction = 0;
     _SpaceRestriction        = SpaceRestrictions.None;
     _RotationRestriction     = RotationRestrictions.XYZ;
 }
Пример #2
0
        private void UpdatePieceRestrictions(ModularPlacableObject Placable)
        {
            _PositionRestriction     = ((int)_PositionRestriction < (int)Placable.PositionRestriction)?Placable.PositionRestriction:_PositionRestriction;       // position restrictions
            _Scalable                = (!Placable.Scalable)?Placable.Scalable:_Scalable;                                                                        // scaling restriction
            _RotationStepRestriction = (Placable.RotationStepRestriction > _RotationStepRestriction)?Placable.RotationStepRestriction:_RotationStepRestriction; // rotation step restrictions
            _RotationRestriction     = ((int)_RotationRestriction < (int)Placable.RotationRestriction)?Placable.RotationRestriction:_RotationRestriction;       // Rotation restrictions
            _SpaceRestriction        = ((int)_SpaceRestriction < (int)Placable.SpaceRestriction)?Placable.SpaceRestriction:_SpaceRestriction;                   // Space restrictions

            if (_PositionRestriction != PositionRestrictions.None)
            {
                _PositionGridRestriction = (_PositionGridRestriction < Placable.PositionGridRestriction) ? Placable.PositionGridRestriction : _PositionGridRestriction;                 // set position grid restriction
            }
        }