Esempio n. 1
0
        // TODO: Find a good place to store this
        public void OpenUserFile(string filePath)
        {
            var stream = new EndianStream(new FileStream(filePath, FileMode.Open), Endian.BigEndian);

            stream.SeekTo(0);
            switch(stream.ReadAscii(0x04))
            {
                case "CON ": case "PIRS" : case "LIVE":
                    break;

                case "_blf":
                    break;

                default:
                    throw new InvalidOperationException("The selected file is not a supported file type. Only try to open an Xbox 360 Container file that contains a forge varient (sandbox.map) or the pure sandbox.map extracted from a Xbox 360 Container File.");
            }
        }
Esempio n. 2
0
 public void Update(EndianStream stream)
 {
     stream.SeekTo(Offset);
     stream.WriteInt32(Ident);
     stream.WriteByte(RunTimeMinimium);
     stream.WriteByte(RunTimeMaximium);
     stream.WriteByte(CountOnMap);
     stream.WriteByte(DesignTimeMaximium);
     stream.WriteFloat(Cost);
 }
Esempio n. 3
0
            public void Update(EndianStream stream)
            {
                stream.SeekTo(Offset + 0x0C);
                stream.WriteInt32(TagIndex);

                stream.WriteFloat(SpawnCoordinates.X);
                stream.WriteFloat(SpawnCoordinates.Y);
                stream.WriteFloat(SpawnCoordinates.Z);
                stream.WriteFloat(SpawnPosition.Right.X);
                stream.WriteFloat(SpawnPosition.Right.Y);
                stream.WriteFloat(SpawnPosition.Right.Z);
                stream.WriteFloat(SpawnPosition.Up.X);
                stream.WriteFloat(SpawnPosition.Up.Y);
                stream.WriteFloat(SpawnPosition.Up.Z);

                stream.SeekTo(stream.Position + 0x0B);
                stream.WriteByte(Team);

                stream.SeekTo(stream.Position + 0x01);
                stream.WriteByte(RespawnTime);

                stream.SeekTo(stream.Position + 0x12);
            }
Esempio n. 4
0
            public void Load(EndianStream stream)
            {
                Offset = stream.Position;
                stream.SeekTo(stream.Position + 0x0C);
                TagIndex = stream.ReadInt32();
                SpawnCoordinates = new Coordinates
                                        {
                                            X = stream.ReadFloat(),
                                            Y = stream.ReadFloat(),
                                            Z = stream.ReadFloat()
                                        };
                SpawnPosition = new Position
                                    {
                                        Right = new Vector3
                                                    {
                                                        X = stream.ReadFloat(),
                                                        Y = stream.ReadFloat(),
                                                        Z = stream.ReadFloat()
                                                    },
                                        Up = new Vector3
                                                    {
                                                        X = stream.ReadFloat(),
                                                        Y = stream.ReadFloat(),
                                                        Z = stream.ReadFloat()
                                                    }
                                    };
                SpawnPosition.Forward = Vector3.Cross(
                    SpawnPosition.Right,
                    SpawnPosition.Up);

                stream.SeekTo(stream.Position + 0x0B);
                Team = stream.ReadByte();

                stream.SeekTo(stream.Position + 0x01);
                RespawnTime = stream.ReadByte();

                stream.SeekTo(stream.Position + 0x12);
            }