public PageInfoJSON(PageInfo pageinfo) { ID = pageinfo.ID; //Interface = pageinfo.Interface; Players = pageinfo.Players; Separator = pageinfo.Separator; Keyboard = pageinfo.Keyboard; //Shortcut = pageinfo.Shortcut; IntervalCallServer = pageinfo.IntervalCallServer; Frame = pageinfo.Frame; //Form = pageinfo.Form; //Control = pageinfo.Control; //TextBox = pageinfo.TextBox; //Collection = pageinfo.Collection; //Button = pageinfo.Button; BackColor = pageinfo.BackColor; BackGroundImage = pageinfo.BackGroundImage; Font_Default = pageinfo.Font_Default; Font_TextBox = pageinfo.Font_TextBox; MapInfo = pageinfo.MapInfo; Translators_Length = pageinfo.Translators.Length; Animations_Length = pageinfo.Animations.Length; Templates_Length = pageinfo.Templates.Length; }
public void Write(string name, ImageJSON imagejson) { WriteStartElement(name); if (imagejson != null) { Write("Name", imagejson.Name); Write("nbrX", imagejson.NbrX); Write("nbrY", imagejson.NbrY); } WriteEndElement(); }
public ImageJSON[] ReadImagesJSON() { ReadStartElement(); int length = ReadInt(); ImageJSON[] imgjson = new ImageJSON[length]; for (int i = 0; i < length; i++) { imgjson[i] = ReadImageJSON(); } ReadEndElement(); return(imgjson); }
//public void Editor_New_Cube(string[] str) //{ // int x = StringToInt(str[1]); // int y = StringToInt(str[2]); // int z = StringToInt(str[3]); // string fulltype = str[4]; // Editor.NewCube(fulltype, x, y, z); // Cube c = Editor.Map.FindCube(x, y, z); // if (c != null) // Add(new MsgJSON_Cubes("EDITOR_NEW_CUBES", new Cube[] { c })); //} //public void Editor_Modify_Cube(string[] str) //{ // int x = StringToInt(str[1]); // int y = StringToInt(str[2]); // int z = StringToInt(str[3]); // string key = str[4]; // if (str[4] == "CLIMB") // Editor.Climb(x, y, z, StringToBool(str[5])); // else if (str[4] == "CROSS") // Editor.Cross(x, y, z, StringToBool(str[5])); // else if (str[4] == "SEE") // Editor.See(x, y, z, StringToBool(str[5])); // else if (str[4] == "ATTACK") // Editor.Attack(x, y, z, StringToBool(str[5])); // else if (str[4] == "FLOORS") // Editor.Floors(x, y, z, Info.JSONDeserialize<ImageJSON[]>(str[5])); // else if (str[4] == "FLOORSPEED") // Editor.FloorSpeed(x, y, z, StringToInt(str[5])); // else if (str[4] == "VOLUMES") // Editor.Volumes(x, y, z, Info.JSONDeserialize<ImageJSON[]>(str[5])); // else if (str[4] == "VOLUMESPEED") // Editor.VolumeSpeed(x, y, z, StringToInt(str[5])); //} public void Editor_Modify_Cube2(string[] str) { int x = StringToInt(str[1]); int y = StringToInt(str[2]); int z = StringToInt(str[3]); int x2 = StringToInt(str[4]); int y2 = StringToInt(str[5]); int z2 = StringToInt(str[6]); string fulltype = str[7]; bool climb = StringToBool(str[8]); bool cross = StringToBool(str[9]); bool see = StringToBool(str[10]); bool attack = StringToBool(str[11]); int floorspeed = StringToInt(str[12]); ImageJSON[] floors = new ImageJSON[0]; if (str[13] != "" && str[13] != "[]") { floors = Info.JSONDeserialize <ImageJSON[]>(str[13]); } int volumespeed = StringToInt(str[14]); ImageJSON[] volumes = new ImageJSON[0]; if (str[15] != "" && str[15] != "[]") { volumes = Info.JSONDeserialize <ImageJSON[]>(str[15]); } if (PageInfo.Map == null || !PageInfo.Map.Contains(x, y, z)) { return; } Cube cube = PageInfo.Map.FindCube(x, y, z); if (cube == null) { if (fulltype == "") { fulltype = "Core.Cube"; } cube = Info.Instance(fulltype) as Cube; if (cube == null) { return; } cube.X = x; cube.Y = y; cube.Z = z; PageInfo.Map.Add(cube); } if (cube != null) { cube.Climb = climb; cube.Cross = cross; cube.See = see; cube.Attack = attack; cube.Floors_Speed = floorspeed; cube.Floors = floors; cube.Volumes_Speed = volumespeed; cube.Volumes = volumes; Add(new MsgJSON_Cubes("CUBES", new Cube[] { cube })); //Add(new MsgJSON_Cubes("EDITOR_CUBES", new Cube[] { cube })); } }