public static void Write(this BinaryWriter write, SystemCoordinate coord) { write.WriteStarString(coord._sector); write.WriteBE(coord._x); write.WriteBE(coord._y); write.WriteBE(coord._z); }
public static Dictionary <string, WorldCoordinate> ReadStarCelestialLog(this BinaryReader read) { Dictionary <string, WorldCoordinate> returnList = new Dictionary <string, WorldCoordinate>(); byte[] celestialLog = read.ReadStarByteArray(); BinaryReader celestialRead = new BinaryReader(new MemoryStream(celestialLog)); uint numVisited = celestialRead.ReadVarUInt32(); for (int i = 0; i < numVisited; i++) { celestialRead.ReadStarSystemCoordinate(); } uint numSectors = celestialRead.ReadVarUInt32(); for (int i = 0; i < numSectors; i++) { celestialRead.ReadStarString(); celestialRead.ReadBoolean(); } byte unk = celestialRead.ReadByte(); SystemCoordinate coords = celestialRead.ReadStarSystemCoordinate(); //Seems to be the current system coords. WorldCoordinate curLoc = celestialRead.ReadStarWorldCoordinate(); if (String.IsNullOrEmpty(curLoc._syscoord._sector)) { curLoc = null; } if (curLoc != null) { returnList.Add("loc", curLoc); } WorldCoordinate curHome = celestialRead.ReadStarWorldCoordinate(); if (String.IsNullOrEmpty(curHome._syscoord._sector)) { curHome = null; } if (curHome != null) { returnList.Add("home", curHome); } return(returnList); }
public WorldCoordinate(string sector, int x, int y, int z, int planet, int satellite) { _syscoord = new SystemCoordinate(sector, x, y, z); _planet = planet; _satellite = satellite; }
public WorldCoordinate() { _syscoord = new SystemCoordinate("", 0, 0, 0); _planet = 0; _satellite = 0; }