예제 #1
0
 public MyProjectorClipboard(MyProjectorBase projector, MyPlacementSettings settings)
     : base(settings) //Pasting Settings here ?
 {
     MyDebug.AssertDebug(projector != null);
     m_projector = projector;
     m_calculateVelocity = false;
 }
예제 #2
0
 public MyProjectorClipboard(MyProjectorBase projector)
     : base(MyPerGameSettings.PastingSettings)
 {
     MyDebug.AssertDebug(projector != null);
     m_projector = projector;
     m_calculateVelocity = false;
 }
예제 #3
0
 public ProjectionRaycastData(BuildCheckResult result, MySlimBlock cubeBlock, MyProjectorBase projector)
 {
     raycastResult = result;
     hitCube = cubeBlock;
     cubeProjector = projector;
 }
예제 #4
0
        /// <summary>
        /// Determines whether the projected grid still fits within block limits set by server after a new block is added
        /// </summary>
        private bool IsWithinWorldLimits(MyProjectorBase projector, string name)
        {
            if (!MySession.Static.EnableBlockLimits) return true;

            bool withinLimits = true;
            var identity = MySession.Static.Players.TryGetIdentity(BuiltBy);
            if (MySession.Static.MaxBlocksPerPlayer > 0)
            {
                withinLimits &= BuiltBy == 0 || IDModule.GetUserRelationToOwner(BuiltBy) != MyRelationsBetweenPlayerAndBlock.Enemies; // Don't allow stolen enemy welders to build
                withinLimits &= projector.BuiltBy == 0 || IDModule.GetUserRelationToOwner(projector.BuiltBy) != MyRelationsBetweenPlayerAndBlock.Enemies; // Don't allow welders to build from enemy projectors
                withinLimits &= identity == null || identity.BlocksBuilt < MySession.Static.MaxBlocksPerPlayer + identity.BlockLimitModifier;
            }
            withinLimits &= MySession.Static.MaxGridSize == 0 || projector.CubeGrid.BlocksCount < MySession.Static.MaxGridSize;
            short typeLimit = MySession.Static.GetBlockTypeLimit(name);
            int typeBuilt;
            if (identity != null && typeLimit > 0)
            {
                withinLimits &= (identity.BlockTypeBuilt.TryGetValue(name, out typeBuilt) ? typeBuilt : 0) < typeLimit;
            }
            return withinLimits;
        }
예제 #5
0
 public MySyncProjector(MyProjectorBase projector)
 {
     m_projector = projector;
 }