Beispiel #1
0
 /// <summary>
 /// Inserts the IMovableGameObject to the SolarSystem and sets SolarSystem visibility
 /// to the object.
 /// </summary>
 /// <param name="imgo">The inserting object.</param>
 public void AddIMGO(IMovableGameObject imgo)
 {
     if (!imgoObjectDict.ContainsKey(imgo.Name))
     {
         imgoObjectDict.Add(imgo.Name, imgo);
         imgo.ChangeVisible(active);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Initializes Traveler and calculates the time of the travel (from the distance between
        /// SolarSystems). Also creates the object invisible and removes it from current SolarSystem.
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="traveler"></param>
        public Traveler(SolarSystem from, SolarSystem to, IMovableGameObject traveler)
        {
            this.from     = from;
            this.to       = to;
            this.traveler = traveler;
            long travelTime = (long)GetSquareOfDistance(from, to);

            timeToGo = new Property <TimeSpan>(new TimeSpan(travelTime * 60));          // Multiply by 60

            traveler.Stop();

            // Removes from current SolarSystem
            from.RemoveIMGO(traveler);
            traveler.ChangeVisible(false);
        }
Beispiel #3
0
        /// <summary>
        /// Initializes Traveler and calculates the time of the travel (from the distance between
        /// SolarSystems). Also creates the object invisible and removes it from current SolarSystem.
        /// </summary>
        /// <param name="from">The SolarSystem with the traveler</param>
        /// <param name="to">The target SolarSystem of the traveler</param>
        /// <param name="traveler">The traveling object</param>
        public Traveler(SolarSystem from, SolarSystem to, IMovableGameObject traveler)
        {
            this.from = from;
            this.to = to;
            this.traveler = traveler;
            long travelTime = (long)GetSquareOfDistance(from, to);

            timeToGo = new Property<TimeSpan>(new TimeSpan(travelTime*60)); // Multiply by 60

            traveler.Stop();

            // Removes from current SolarSystem
            from.RemoveIMGO(traveler);
            traveler.ChangeVisible(false);
        }
Beispiel #4
0
 /// <summary>
 /// Inserts the IMovableGameObject to the SolarSystem and sets SolarSystem visibility
 /// to the object. 
 /// </summary>
 /// <param name="imgo">The inserting object.</param>
 public void AddIMGO(IMovableGameObject imgo)
 {
     if (!imgoObjectDict.ContainsKey(imgo.Name)) {
         imgoObjectDict.Add(imgo.Name, imgo);
         imgo.ChangeVisible(active);
     }
 }