public VArtifactTown(NativeCamp nc, IntVector2 posGen) { type = VArtifactType.NativeCamp; templateId = nc.cid; level = nc.level; nativeTower = nc.nativeTower; PosGen = posGen; nativeType = (NativeType)nc.nativeType; }
public static void TestXxmlCreating() { string filePath = Application.dataPath + "/TestNativeCampXML"; Directory.CreateDirectory(filePath); filePath += "/VANativeCamp.xml"; using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write)) { XmlSerializer serialize = new XmlSerializer(typeof(VANativeCampDesc)); NpcIdNum[] npcIdNum = new NpcIdNum[2]; npcIdNum[0] = new NpcIdNum(); npcIdNum[1] = new NpcIdNum(); BuildingIdNum[] bdnum = new BuildingIdNum[2]; bdnum[0] = new BuildingIdNum(); bdnum[1] = new BuildingIdNum(); ArtifactUnit artifactUnit = new ArtifactUnit(); artifactUnit.id = "-1"; artifactUnit.pos = "100,200"; artifactUnit.rot = "-1"; artifactUnit.npcIdNum = npcIdNum; artifactUnit.buildingIdNum = bdnum; ArtifactUnit[] artifactUnitArray = new ArtifactUnit[] { artifactUnit, artifactUnit }; NativeCamp camp = new NativeCamp(); camp.artifactUnitArray = artifactUnitArray; DynamicNative dn = new DynamicNative(); NativeTower nt = new NativeTower(); nt.dynamicNatives = new DynamicNative[] { dn, dn }; camp.nativeTower = nt; VANativeCampDesc ncd = new VANativeCampDesc(); NativeCamp[] townArry = new NativeCamp[] { camp, camp }; ncd.nativeCamps = townArry; serialize.Serialize(fs, ncd); } }