コード例 #1
0
        /// <summary>
        /// Checks the sun's parameters for validity.
        /// </summary>
        /// <param name="factory">The factory.</param>
        private void ScanFactory(SunFactory factory)
        {
            if (factory == null)
            {
                return;
            }

            if (factory.Mass != null &&
                (factory.Mass.Low < 0 || factory.Mass.High < 0))
            {
                AddIssue("Mass is negative and will be ignored.", factory, "Mass", IssueType.Information);
            }
            if (factory.Radius != null &&
                (factory.Radius.Low <= 0 || factory.Radius.High <= 0))
            {
                AddIssue("Sun radius should be larger then zero.", factory, "Radius", IssueType.Warning);
            }
        }
コード例 #2
0
        private void RenderSunPreview(SunFactory factory)
        {
            if (!SetPreviews(PreviewType.Ingame, factory))
            {
                return;
            }
            if (factory == null)
            {
                return;
            }

            var entity = factory.Sample(_ingamePreview.Manager, FarPosition.Zero, null);

            if (entity > 0 && factory.Radius.Low != factory.Radius.High)
            {
                _ingamePreview.Manager.AddComponent <IngamePreviewControl.PlanetMaxBounds>(entity).MaxRadius =
                    factory.Radius.High;
            }
        }