Example #1
0
        public ClearZone(int t0, Actor who, ZoneLoc dest) : base(t0, who)
        {
            m_Zone  = dest;
            threats = who.Threats    // these two should agree on whether they're null or not
#if DEBUG
                      ?? throw new ArgumentNullException("who.Threats")
#endif
            ;
            tourism = who.InterestingLocs
#if DEBUG
                      ?? throw new ArgumentNullException("who.InterestingLocs")
#endif
            ;
            Func <Point, bool> ok = pt => m_Zone.Rect.Contains(pt);
            m_Unverified.UnionWith(threats.ThreatWhere(dest.m).Where(ok));
            m_Unverified.UnionWith(tourism.In(dest.m).Where(ok));
#if OBSOLETE
            // the civilian case
            if (null == threats && null == sights_to_see)
            {
                m_Unverified.UnionWith(m_Zone.Rect.Where(pt => who.CanEnter(new Location(m_Zone.m, pt)))); // \todo? eliminate GC thrashing
            }
#endif
            // nonserialized fields
            oai = (m_Actor.Controller as ObjectiveAI)
#if DEBUG
                  ?? throw new ArgumentNullException("who.Controller is ObjectiveAI")
#endif
            ;
        }
Example #2
0
 public override void RepairLoad()
 {
     threats = m_Actor.Threats !;
     tourism = m_Actor.InterestingLocs !;
 }