コード例 #1
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="s">Object being copied.</param>
 public StellarObject(StellarObject s)
 {
     this.age = s.age;
        this.stellarType = s.stellarType;
        this.isFlareStar = s.isFlareStar;
        this.brightness = s.brightness;
        this.stellarMass = s.stellarMass;
        this.stellarName = s.stellarName;
        this.ident = s.ident;
 }
コード例 #2
0
        /// <summary>
        /// This function will find the distance if the object is in the list.
        /// </summary>
        /// <param name="so">The stellar object being checked for</param>
        /// <param name="dist">The distance. Will return NaN if not found</param>
        /// <returns>True on success, false if not.</returns>
        public bool findDistanceIfObjectExists(StellarObject so, out double dist)
        {
            if (this.starObject.ident == so.ident)
            {
                dist = this.distanceFromCenter;
                return true;
            }

            else
            {
                dist = Double.NaN;
                return false; //object not found.
            }
        }
コード例 #3
0
 /// <summary>
 /// Full constructor
 /// </summary>
 /// <param name="so">The stellar object</param>
 /// <param name="order">The order of the object</param>
 /// <param name="dist">distance from center</param>
 public starLayout(StellarObject so, int order, double dist)
 {
     this.starObject = so;
     this.starOrder = order;
     this.distanceFromCenter = dist;
 }
コード例 #4
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="s">starLayout being copied</param>
 public starLayout(starLayout s)
 {
     this.starObject = new StellarObject(s.starObject);
     this.starOrder = s.starOrder;
     this.distanceFromCenter = s.distanceFromCenter;
 }
コード例 #5
0
 public starLayout()
 {
     this.starObject = null;
 }
コード例 #6
0
 public void setStellarObject(StellarObject sObject)
 {
     this.starObject = new StellarObject(sObject);
 }