コード例 #1
0
        public void WorldLocationSerializationTest()
        {
            WorldLocation location1 = new WorldLocation(-17, 13, -45.3f, 62.8f, 91.7f);
            WorldLocation location2;

            using (BinaryWriter writer = new BinaryWriter(new MemoryStream()))
            {
                WorldLocation.Save(location1, writer);
                writer.BaseStream.Position = 0;
                using (BinaryReader reader = new BinaryReader(writer.BaseStream))
                    location2 = WorldLocation.Restore(reader);
            }

            Assert.IsTrue(Equals(location1, location2));
        }