Пример #1
0
        //NOTE: It's ok to pass in the base dna type.  If the derived is passed in, those settings will be used
        public CameraHardCoded(EditorOptions options, ItemOptions itemOptions, ShipPartDNA dna, IContainer energyTanks, Map map)
            : base(options, dna, itemOptions.Camera_Damage.HitpointMin, itemOptions.Camera_Damage.HitpointSlope, itemOptions.Camera_Damage.Damage)
        {
            _itemOptions = itemOptions;
            _energyTanks = energyTanks;
            _map         = map;

            this.Design = new CameraHardCodedDesign(options, true);
            this.Design.SetDNA(dna);

            double radius;

            CameraColorRGB.GetMass(out _mass, out _volume, out radius, dna, itemOptions);

            this.Radius  = radius;
            _scaleActual = new Vector3D(radius * 2d, radius * 2d, radius * 2d);

            //TODO: design should have stored custom stuff if the dna has it.  Get/Set
            var neuronResults = CreateNeurons(dna, itemOptions);

            _neuronPoints = neuronResults.Item1;
            _neuronSets   = neuronResults.Item2;
            _neurons      = neuronResults.Item2.
                            SelectMany(o => o).
                            ToArray();
            _neuronMaxRadius = _neurons.Max(o => o.PositionLength);
        }