public static Model.World createWorld(LandType landType, ProxyGenerator proxyGenerator) { var world = TestWorldBuilder.createTestWorld(100, 10); world.ForEach((v, _) => { v.Data.Type = landType; }); return(world); }
public void TestDeserialize() { var el = serialize(); var world = TestWorldBuilder.createTestWorld(10, 10); var store = new GenericDatastore(world); store.Deserialize(el); var list = store.RootRecord.GetList("Towns", r => new Town(null, r)); list.Print(); list[0].TownVoxels.Print(); list[0].TownCenter.ToString().Print(); }
private static XElement serialize() { var world = TestWorldBuilder.createTestWorld(10, 10); var store = new GenericDatastore(world); var list = store.RootRecord.GetList("Towns", r => new Town(null, r)); var town = new Town(createService(), store.RootRecord.CreateRecord()); town.SetTownCenter(world.GetVoxel(new Point2(3, 8))); list.Add(town); town.AddVoxel(world.GetVoxel(new Point2(3, 7))); var doc = store.Serialize(); return(doc); }