Example #1
0
        /// <summary>
        /// Creates a new system contact.
        /// </summary>
        /// <param name="Fact">Faction of contact.</param>
        /// <param name="entity">Backing entity of the contact.</param>
        public SystemContact(Faction Fact, StarSystemEntity entity)
        {
            Id           = Guid.NewGuid();
            faction      = Fact;
            Position     = entity.Position;
            LastPosition = Position;

            Entity = entity;

            DistTable = new DistanceTable(this);

            SSEntity = entity.SSEntity;
        }
Example #2
0
        /// <summary>
        /// Creates a new system contact.
        /// </summary>
        /// <param name="Fact">Faction of contact.</param>
        /// <param name="entity">Backing entity of the contact.</param>
        public SystemContact(Faction Fact, StarSystemEntity entity)
        {
            Id           = Guid.NewGuid();
            faction      = Fact;
            Position     = entity.Position;
            LastPosition = Position;

            Entity = entity;

            DistTable = new DistanceTable(this);

            SSEntity = entity.SSEntity;

            //add legal orders to list
            _legalOrders.Add(Constants.ShipTN.OrderType.Follow);
        }
Example #3
0
        /// <summary>
        /// MessageEntry constructs a specific message with the relevant location, time, and entity(if applicable).
        /// </summary>
        /// <param name="Loc">Starsystem message is from.</param>
        /// <param name="Ref">Starsystementity the message refers to.</param>
        /// <param name="Time">Game time of message.</param>
        /// <param name="timeSlice">Time since last increment.</param>
        /// <param name="text">text of the message.</param>
        public MessageEntry(MessageType Type, StarSystem Loc, StarSystemEntity Ref, DateTime Time, int timeSlice, string text)
        {
            TypeOf        = Type;
            Location      = Loc;
            entity        = Ref;
            TimeOfMessage = Time;
            TimeSlice     = timeSlice;
            Text          = text;


#if LOG4NET_ENABLED
            if (TypeOf == MessageType.Error)
            {
                String Entry = String.Format("Faction Message Logging Error: Type:{0} | Time:{1} | Location:{2} - TimeSlice:{3}: Text:{4}\n", TypeOf, TimeOfMessage, Location, TimeSlice, Text);
                logger.Debug(Entry);
            }
#endif
        }
Example #4
0
        /// <summary>
        /// creates a list of orders by creating a union and intersection of other lists.
        /// </summary>
        /// <param name="thisTG"></param>
        /// <param name="targetEntity"></param>
        /// <param name="previousOrders"></param>
        /// <returns></returns>
        private List<Constants.ShipTN.OrderType> legalOrders(TaskGroupTN thisTG, StarSystemEntity targetEntity, List<Order> previousOrders)
        {
            List<Constants.ShipTN.OrderType> thisTGLegalOrders = new List<Constants.ShipTN.OrderType>();
            List<Constants.ShipTN.OrderType> additionalOrders = new List<Constants.ShipTN.OrderType>();
            List<Constants.ShipTN.OrderType> targetEntityLegalOrders = targetEntity.LegalOrders(CurrentTaskGroup.TaskGroupFaction);

            if (!m_oTaskGroupPanel.OrderFilteringCheckBox.Checked)
            {
                thisTGLegalOrders = Enum.GetValues(typeof(Constants.ShipTN.OrderType)).Cast<Constants.ShipTN.OrderType>().ToList();
            }
            else
            {
                thisTGLegalOrders = thisTG.LegalOrdersTG();
                foreach (var order in previousOrders)
                {
                    additionalOrders = additionalOrders.Union(order.EnablesTypeOf()).ToList();
                }
                thisTGLegalOrders = thisTGLegalOrders.Union(additionalOrders).ToList();
            }

            //it still needs to do an intersect with the targetEntityLegalOrders, regardless of filtering.
            thisTGLegalOrders = thisTGLegalOrders.Intersect(targetEntityLegalOrders).ToList();

            return thisTGLegalOrders;
        }
Example #5
0
 public SystemListObject(ListEntityType entityType, StarSystemEntity entity)
 {
     Entity = entity;
     EntityType = entityType;
 }
Example #6
0
        /// <summary>
        /// Creates a new system contact.
        /// </summary>
        /// <param name="Fact">Faction of contact.</param>
        /// <param name="entity">Backing entity of the contact.</param>
        public SystemContact(Faction Fact, StarSystemEntity entity)
        {
            Id = Guid.NewGuid();
            faction = Fact;
            Position = entity.Position;
            LastPosition = Position;

            Entity = entity;

            DistTable = new DistanceTable(this);

            SSEntity = entity.SSEntity;

            //add legal orders to list
            _legalOrders.Add(Constants.ShipTN.OrderType.Follow);
        }
Example #7
0
        /// <summary>
        /// MessageEntry constructs a specific message with the relevant location, time, and entity(if applicable). 
        /// </summary>
        /// <param name="Loc">Starsystem message is from.</param>
        /// <param name="Ref">Starsystementity the message refers to.</param>
        /// <param name="Time">Game time of message.</param>
        /// <param name="timeSlice">Time since last increment.</param>
        /// <param name="text">text of the message.</param>
        public MessageEntry(MessageType Type, StarSystem Loc, StarSystemEntity Ref, DateTime Time, int timeSlice, string text)
        {
            TypeOf = Type;
            Location = Loc;
            entity = Ref;
            TimeOfMessage = Time;
            TimeSlice = timeSlice;
            Text = text;


#if LOG4NET_ENABLED
            if (TypeOf == MessageType.Error)
            {
                String Entry = String.Format("Faction Message Logging Error: Type:{0} | Time:{1} | Location:{2} - TimeSlice:{3}: Text:{4}\n", TypeOf, TimeOfMessage, Location, TimeSlice, Text);
                logger.Debug(Entry);
            }
#endif
        }