Beispiel #1
0
        public LaserBeam(Vector2 startingPosition, Vector2 velocity, Trackable ownerEntity)
        {
            _position = startingPosition;
            _velocity = velocity;
            _ownerEntity = ownerEntity;

            Initialize();
        }
 /// <summary>
 ///     Adds a string to Trackable pair for the passed entity to the dictionary _entities.
 ///     
 ///     If a pair already exists this method does nothing.
 /// </summary>
 /// <param name="entity">The entity to create the pair for.</param> 
 /// <seealso cref="getTrackedEntity"/>  
 /// <seealso cref="forgetEntity"/>
 public static void trackEntity(Trackable entity)
 {
     // If the entity is valid and not already present in the dictionary
     if (entity != null && EntityTracker.getTrackedEntity(entity.getUUID()) == null)
     {
         // Add this entity to the dictionary
         _entities.Add(entity.getUUID(), entity);
     }
 }
 /// <summary>
 ///     Removes the string to Trackable pair for the passed entity from the dictionary _entities.
 /// </summary>
 /// <param name="entity">The entity reference to remove from the dictionary.</param>
 /// <seealso cref="getTrackedEntity"/>  
 /// <seealso cref="trackEntity"/>
 public static void forgetEntity(Trackable entity)
 {
     // If the entity is valid
     if (entity != null)
     {
         // Remove this entity from the dictionary
         _entities.Remove(entity.getUUID());
     }
 }