Example #1
0
        public RoadAIWrapper(NetAI ai)
        {
            m_ai = ai;

            try
            {
                m_elevated  = m_ai.GetType().GetField("m_elevatedInfo");
                m_bridge    = m_ai.GetType().GetField("m_bridgeInfo");
                m_slope     = m_ai.GetType().GetField("m_slopeInfo");
                m_tunnel    = m_ai.GetType().GetField("m_tunnelInfo");
                m_invisible = m_ai.GetType().GetField("m_invisible");
            }
            catch
            {
                m_elevated  = null;
                m_bridge    = null;
                m_slope     = null;
                m_tunnel    = null;
                m_invisible = null;
            }
        }
Example #2
0
 static void SimulationStep(NetAI _this, ushort segmentID, ref NetSegment data)
 {
     try
     {
         _this.SimulationStep(segmentID, ref data);
     }
     catch (Exception e)
     {
         string info = $"An exception occured during NetAI simulation step.\nAsset: {_this.m_info.name}" +
                       $"\nSegmentID: {segmentID}\nType: {_this.GetType().Name}\nSeverity: High";
         HealkitException e2 = new HealkitException(info, e);
         e2.m_uniqueData   = _this.m_info.name;
         e2.m_supperessMsg = "Suppress similar exceptions caused by this asset";
         UIView.ForwardException(e2);
     }
 }