Ejemplo n.º 1
0
 public Sector(LocationDef location)
 {
     this.Type      = SectorType.Space;
     this.X         = location.Sector.X;
     this.Y         = location.Sector.Y;
     this.RegionDef = location.Region;
 }
Ejemplo n.º 2
0
        public SectorDef(LocationDef location, SectorItem sectorItem)
        {
            string sectorSetupError = (new StarTrekKGSettings()).GetText("SectorDefSetupError");

            if (location.Sector.X < Constants.SECTOR_MIN)
            {
                throw new GameConfigException(sectorSetupError + " Sector x < " + Constants.SECTOR_MIN);
            }

            if (location.Sector.X > Constants.SECTOR_MAX)
            {
                throw new GameConfigException(sectorSetupError + " Sector x > " + Constants.SECTOR_MAX);
            }

            if (location.Sector.Y < Constants.SECTOR_MIN)
            {
                throw new GameConfigException(sectorSetupError + "Sector y < " + Constants.SECTOR_MIN);
            }

            if (location.Sector.Y > Constants.SECTOR_MAX)
            {
                throw new GameConfigException(sectorSetupError + "Sector y > " + Constants.SECTOR_MAX);
            }

            this.Sector    = new Sector(new LocationDef(location.Region, new Coordinate(location.Sector.X, location.Sector.Y)));
            this.Item      = sectorItem;
            this.RegionDef = location.Region;
        }
Ejemplo n.º 3
0
 public Sector(LocationDef location, bool enforceBoundsChecking)
 {
     this.Type = SectorType.Space;
     this._errorOnOutOfBounds = enforceBoundsChecking;
     this.X         = location.Sector.X;
     this.Y         = location.Sector.Y;
     this.RegionDef = location.Region;
 }
Ejemplo n.º 4
0
        internal static IRSResult GetInfo(IMap iMap, LocationDef locationToScan)
        {
            //copy LRS Render

            //var tlrsResults = shipLocation.Region.GetLRSFullData(shipLocation, this.Game);
            //var renderedData = this.Game.Write.RenderLRSData(tlrsResults, this.Game);
            throw new NotImplementedException();
        }
Ejemplo n.º 5
0
        public static void SetupNewSector(SectorDef sectorDef, Sectors newSectors, Regions Regions)
        {
            //todo: rewrite this function to get rid of GOTO

StartOver:
            var randomSector = Coordinate.GetRandom();

            if (newSectors.NotFound(randomSector))
            {
                Sectors.SetupRandomRegionDef(sectorDef, Regions);

                var locationDef = new LocationDef(sectorDef.RegionDef, new Coordinate(sectorDef.Sector.X, sectorDef.Sector.Y));
                var newSector   = new Sector(locationDef);
                newSector.Item = sectorDef.Item;

                newSectors.Add(newSector);
            }
            else
            {
                //Console.WriteLine("Sector already Set up: " + sectorDef.Sector.X + "," + sectorDef.Sector.Y);
                goto StartOver;
            }
        }
Ejemplo n.º 6
0
 internal static IRSResult GetInfo(LocationDef locationToScan)
 {
     throw new NotImplementedException();
 }