Пример #1
0
 public Coords(GalacticLocation location)
 {
     this._galacticLocation = location;
     this._sectorLocation   = _galacticLocation.ToSectorLocation();
     this._screenLocation   = new ScreenLocation(_sectorLocation);
     this._sectorIndexX     = (uint)(_galacticLocation.X / GalaxyConstants.SectorWidth);
     this._sectorIndexY     = (uint)(_galacticLocation.Y / GalaxyConstants.SectorWidth);
 }
Пример #2
0
 public Coords(uint sectorIndexX, uint sectorIndexY, SectorLocation sectorLocation)
 {
     this._sectorIndexX     = sectorIndexX;
     this._sectorIndexY     = sectorIndexY;
     this._sectorLocation   = new SectorLocation(sectorLocation.X, sectorLocation.Y, sectorLocation.Z);
     this._galacticLocation = new GalacticLocation(sectorIndexX, sectorIndexY, sectorLocation);
     this._screenLocation   = new ScreenLocation(sectorLocation);
 }
Пример #3
0
 public Coords(uint sectorIndexX, uint sectorIndexY, int sX, int sY, int sZ)
 {
     this._sectorIndexX     = sectorIndexX;
     this._sectorIndexY     = sectorIndexY;
     this._sectorLocation   = new SectorLocation(sX, sY, sZ);
     this._galacticLocation = new GalacticLocation(_sectorIndexX, _sectorIndexY, _sectorLocation);
     this._screenLocation   = new ScreenLocation(_sectorLocation);
 }
Пример #4
0
 public Coords(uint sectorIndexX, uint sectorIndexY)
 {
     this._sectorIndexX     = sectorIndexX;
     this._sectorIndexY     = sectorIndexY;
     this._sectorLocation   = new SectorLocation(0, 0, 0);
     this._galacticLocation = new GalacticLocation(sectorIndexX, sectorIndexY, _sectorLocation);
     this._screenLocation   = new ScreenLocation(_sectorLocation);
 }
Пример #5
0
        public Coords(SerializationInfo info, StreamingContext context)
        {
            this._sectorIndexX = info.GetUInt32("sectorIndexX");
            this._sectorIndexY = info.GetUInt32("sectorIndexY");
            int sX, sY, sZ;

            sX = info.GetInt32("sX");
            sY = info.GetInt32("sY");
            sZ = info.GetInt32("sZ");

            this._sectorLocation   = new SectorLocation(sX, sY, sZ);
            this._galacticLocation = new GalacticLocation(_sectorIndexX, _sectorIndexY, _sectorLocation);
            this._screenLocation   = new ScreenLocation(_sectorLocation);
        }
Пример #6
0
 public GalacticLocation(uint sectorIndexX, uint sectorIndexY, SectorLocation sectorLocation)
 {
     this.X = (
         (sectorIndexX * GalaxyConstants.SectorWidth) +
         (
             (sectorLocation.X + GalaxyConstants.LocalSectorWidth / 2) *
             GalaxyConstants.SectorWidth / GalaxyConstants.LocalSectorWidth
         )
         );
     this.Y = (
         (sectorIndexY * GalaxyConstants.SectorWidth) +
         (
             (sectorLocation.Y + GalaxyConstants.LocalSectorWidth / 2) *
             GalaxyConstants.SectorWidth / GalaxyConstants.LocalSectorWidth
         )
         );
     this.Z = (sectorLocation.Z + GalaxyConstants.LocalSectorDepth / 2) * GalaxyConstants.SectorDepth / GalaxyConstants.LocalSectorDepth;
 }
Пример #7
0
 public ScreenLocation(SectorLocation sLocation)
 {
     this.X = sLocation.X * 8;
     this.Y = sLocation.Y * 8;
     this.Z = sLocation.Z + 128;
 }