//CONSTRUCTOR public MapObjectNameless(int? nposX = null, int posY=0, int posZ = 0, string type = "") { int posX = nposX ?? Space.MaxX; _type = MapObjectNamelessType.nothing; TypeToString_Display = type; _coordinatesStart = new Coordinates3DUnbound(true, posX, posY, posZ, true); _coordinatesEnd = this._coordinatesStart; _count = 1; Imported = false; }
//FROM XML public void FromXml(XmlNode item) { bool end_C_specified = false; bool end_A_specified = false; foreach (XmlAttribute att in item.Attributes) { switch (att.Name) { case "startX": _coordinatesStart.X = Helper.StringToDouble(att.Value); break; case "startY": _coordinatesStart.Y = Helper.StringToDouble(att.Value); break; case "startZ": _coordinatesStart.Z = Helper.StringToDouble(att.Value); break; case "endX": _coordinatesEnd.X = Helper.StringToDouble(att.Value); end_C_specified = true; break; case "endY": _coordinatesEnd.Y = Helper.StringToDouble(att.Value); end_C_specified = true; break; case "endZ": _coordinatesEnd.Z = Helper.StringToDouble(att.Value); end_C_specified = true; break; case "startAngle": A_Start_deg = Helper.StringToDouble(att.Value); break; case "endAngle": A_End_deg = Helper.StringToDouble(att.Value); end_A_specified = true; break; case "randomSeed": _randomSeed = Helper.StringToInt(att.Value); break; case "count": _count = Helper.StringToInt(att.Value); break; case "radius": _radius = Helper.StringToInt(att.Value); break; case "randomRange": _randomRange = Helper.StringToInt(att.Value); break; } } if (!end_A_specified) _aEnd = _aStart; if (!end_C_specified) _coordinatesEnd = _coordinatesStart; }
//COPIER public void Copy(bool excludeStartCoordinate, MapObjectNameless source) { if (source == null) return; if (!excludeStartCoordinate) this._coordinatesStart = source._coordinatesStart; this._coordinatesEnd = this._coordinatesStart + source._coordinatesEnd - source._coordinatesStart; this._aEnd = source._aEnd; this._aStart = source._aStart; this._count = source._count; this._radius = source._radius; this._randomRange = source._randomRange; this._randomSeed = source._randomSeed; if (this._type == MapObjectNamelessType.nothing) this._type = source._type; }