예제 #1
0
        public override string LegendsDescription()
        {
            string timestring = base.LegendsDescription();

            if (EventCollection != null)
            {
                EC_War war = (EC_War)EventCollection;
                return(string.Format("{0} {1} rejected an offer of peace from {2}.",
                                     timestring, war.AggressorEnt.ToString(), war.DefenderEnt.ToString()));
            }
            else
            {
                return(timestring);
            }
        }
예제 #2
0
        internal override string ToTimelineString()
        {
            string timelinestring = base.ToTimelineString();

            if (EventCollection != null)
            {
                EC_War war = (EC_War)EventCollection;
                return(string.Format("{0} {1} rejected peace from {2}.",
                                     timelinestring, war.AggressorEnt.ToString(),
                                     war.DefenderEnt.ToString()));
            }
            else
            {
                return(timelinestring);
            }
        }
예제 #3
0
        private WorldTime GetTimeAtWar(WorldTime endAtTime)
        {
            var warCollections = Entity?.WarEventCollections.OrderBy(x => x.StartTime.ToSeconds()).ToList();

            EC_War    war = warCollections.First();
            WorldTime curStartTime;
            WorldTime timeAtWar = new WorldTime(0);

            do
            {
                var endTime = war.EndTime < endAtTime ? war.EndTime : endAtTime;
                curStartTime = war.StartTime;
                timeAtWar   += (endTime - curStartTime);
                if (endTime == endAtTime)
                {
                    break;
                }
                warCollections = warCollections.Where(x => x.EndTime > war.EndTime).OrderBy(x => x.StartTime.ToSeconds()).ToList();
                war            = warCollections.FirstOrDefault();
            } while (warCollections.Count() > 0);

            return(timeAtWar);
        }