Example #1
0
        public static void StorePatchMethod2(long id,
                                             int amount,
                                             MyPlayer player,
                                             MyStation station,
                                             long sourceEntityId,
                                             long lastEconomyTick)
        {
            if (!Ids.ContainsKey(player.Identity.IdentityId))
            {
                Ids.Add(id, player.Identity.IdentityId);
            }

            return;
        }
Example #2
0
 public void ChangeName()
 {
     MyStation.ChangeName();
     LoadData();
 }
Example #3
0
        private Vector3D?FindSuitableJumpLocationSpace(Vector3D desiredLocation)
        {
            List <MyObjectSeed> m_objectsInRange   = new List <MyObjectSeed>();
            List <BoundingBoxD> m_obstaclesInRange = new List <BoundingBoxD>();
            List <MyEntity>     m_entitiesInRange  = new List <MyEntity>();


            BoundingSphereD Inflated = SphereD;

            Inflated.Radius *= 1.5;
            Inflated.Center  = desiredLocation;

            Vector3D vector3D = desiredLocation;

            MyProceduralWorldGenerator.Static.OverlapAllAsteroidSeedsInSphere(Inflated, m_objectsInRange);
            foreach (MyObjectSeed item3 in m_objectsInRange)
            {
                m_obstaclesInRange.Add(item3.BoundingVolume);
            }
            m_objectsInRange.Clear();

            MyProceduralWorldGenerator.Static.GetAllInSphere <MyStationCellGenerator>(Inflated, m_objectsInRange);
            foreach (MyObjectSeed item4 in m_objectsInRange)
            {
                MyStation myStation = item4.UserData as MyStation;
                if (myStation != null)
                {
                    BoundingBoxD item = new BoundingBoxD(myStation.Position - MyStation.SAFEZONE_SIZE, myStation.Position + MyStation.SAFEZONE_SIZE);
                    if (item.Contains(vector3D) != 0)
                    {
                        m_obstaclesInRange.Add(item);
                    }
                }
            }
            m_objectsInRange.Clear();


            MyGamePruningStructure.GetAllTopMostEntitiesInSphere(ref Inflated, m_entitiesInRange);
            foreach (MyEntity item5 in m_entitiesInRange)
            {
                if (!(item5 is MyPlanet))
                {
                    m_obstaclesInRange.Add(item5.PositionComp.WorldAABB.GetInflated(Inflated.Radius));
                }
            }

            int          num          = 10;
            int          num2         = 0;
            BoundingBoxD?boundingBoxD = null;
            bool         flag         = false;
            bool         flag2        = false;

            while (num2 < num)
            {
                num2++;
                flag = false;
                foreach (BoundingBoxD item6 in m_obstaclesInRange)
                {
                    ContainmentType containmentType = item6.Contains(vector3D);
                    if (containmentType == ContainmentType.Contains || containmentType == ContainmentType.Intersects)
                    {
                        if (!boundingBoxD.HasValue)
                        {
                            boundingBoxD = item6;
                        }
                        boundingBoxD = boundingBoxD.Value.Include(item6);
                        boundingBoxD = boundingBoxD.Value.Inflate(1.0);
                        vector3D     = ClosestPointOnBounds(boundingBoxD.Value, vector3D);
                        flag         = true;
                        break;
                    }
                }
                if (!flag)
                {
                    flag2 = true;
                    break;
                }
            }
            m_obstaclesInRange.Clear();
            m_entitiesInRange.Clear();
            m_objectsInRange.Clear();
            if (flag2)
            {
                return(vector3D);
            }
            return(null);
        }