public override void Parse(GameConfigurationSection sect) { base.Parse(sect); modelName = sect["Model"]; scale = sect.GetSingle("Radius", 1); rot = sect.GetSingle("Amount", 0); float radLng = MathEx.Degree2Radian(Longitude); float radLat = MathEx.Degree2Radian(Latitude); float alt = TerrainData.Instance.QueryHeight(radLng, radLat); Position = PlanetEarth.GetPosition(radLng, radLat, PlanetEarth.PlanetRadius + alt * TerrainMeshManager.PostHeightScale); Orientation = PlanetEarth.GetOrientation(radLng, radLat); }
/// <summary> /// 配置文件解析 /// </summary> /// <param name="sect"></param> public virtual void Parse(GameConfigurationSection sect) { Longitude = sect.GetSingle("Longitude"); Latitude = sect.GetSingle("Latitude"); }
public override void Parse(GameConfigurationSection sect) { base.Parse(sect); Radius = sect.GetSingle("Radius"); float radLng = MathEx.Degree2Radian(Longitude); float radLat = MathEx.Degree2Radian(Latitude); stdPosition = PlanetEarth.GetPosition(radLng, radLat, PlanetEarth.PlanetRadius); }
public override void Parse(GameConfigurationSection sect) { base.Parse(sect); string type = sect.GetString("Type", string.Empty).ToLowerInvariant(); if (type == "wood") { this.Type = NaturalResourceType.Wood; } else if (type == "petro") { this.Type = NaturalResourceType.Oil; } CurrentAmount = sect.GetSingle("Amount", 0); //MaxAmount = CurrentAmount * FTimesMaxAmount; UpdateLocation(); Reset(CurrentAmount); }
public override void Parse(GameConfigurationSection sect) { base.Parse(sect); this.Name = sect.GetString("Name", string.Empty); StartUp = sect.GetInt("StartUp", -1); linkableCityName = sect.GetStringArray("Linkable", null); development = sect.GetSingle("InitialDevelopment", RulesTable.CityInitialDevelopment); healthValue = CurrentMaxHealth; float facing = MathEx.PIf + (Randomizer.GetRandomSingle() - 0.5f) * MathEx.PiOver2; //currentFacing = MathEx.PIf * (5f / 6 + Randomizer.GetRandomSingle() / 3); currentFacing = Quaternion.RotationAxis(Vector3.UnitY, facing); UpdateLocation(); }