Ejemplo n.º 1
0
		//----------------------------------------------------------------------
		// Initialize; this is the engine entry point (called by the core);
		//----------------------------------------------------------------------
		public static void Initialize()
		{
			m_RegionHash = new Hashtable();

			Console.Write( "Random Encounters: Initializing..." );

			if( MaybeLoadXml() )
			{
				//if (m_Debug) DumpAll();

				string intervals = "";

				for( int i = 0; i < m_Intervals.Length; i++ )
				{
					if( i != 0 ) intervals += ":";

					intervals += m_Intervals[i];
				}

				//Dungeon Wilderness Guarded House Jail

				m_EncounterTimers = new EncounterTimer[m_Intervals.Length];

				if( m_Intervals.Length >= 3 )
				{
					m_EncounterTimers[0] = new EncounterTimer( "Dungeon", m_Intervals[0] );
					m_EncounterTimers[1] = new EncounterTimer( "Wilderness", m_Intervals[1] );
					m_EncounterTimers[2] = new EncounterTimer( "Guarded", m_Intervals[2] );
				}
				if( m_Intervals.Length >= 4 )
				{
					//m_EncounterTimers[3] = new EncounterTimer( "House", m_Intervals[3] );
					Console.WriteLine( "RandomEncounters: WARNING, House Spawning not implemented yet." );
				}
				if( m_Intervals.Length == 5 )
				{
					//m_EncounterTimers[4] = new EncounterTimer( "Jail", m_Intervals[4] );
					Console.WriteLine( "RandomEncounters: WARNING, Jail Spawning not implemented yet." );
				}

				foreach( EncounterTimer timer in m_EncounterTimers ) timer.Start();

				if( m_ReinitializeTimer == null )
				{
					m_ReinitializeTimer = new ReinitializeTimer();
					m_ReinitializeTimer.Start();
				}

				//        if (cleanupList.Count>0)
				//        {
				//            DeleteEncounterTimer deleter = new DeleteEncounterTimer( m_Cleanup, cleanupList );
				//            deleter.Start();
				//        }

				m_DeleteTimer = new DeleteTimer( Cleanup, Cleanup );
				m_DeleteTimer.Start();

				Console.WriteLine( "done" );
			}
			else
			{
				Console.WriteLine( "failed!" );
			}
		}
Ejemplo n.º 2
0
    //----------------------------------------------------------------------
    // Initialize; this is the engine entry point (called by the core);
    //----------------------------------------------------------------------
    public static void Initialize()
    {
        m_RegionHash = new Hashtable();

        if (MaybeLoadXml())
        {
            //if (m_Debug) DumpAll();

            string intervals = "";

            for( int i=0; i < m_Intervals.Length; i++ )
            {
                if( i!=0 ) intervals += ":";

                intervals += m_Intervals[i];
            }

            Console.WriteLine(
                "RE: **WE'RE LIVE, BABY***..."
                );
            Console.WriteLine(
                "    [picker={0} language={1} skiphidden={2} delay={3} intervals={4} cleanup={5} grace={6} debug={7} animateDebug={8}]",
                m_Picker,
                m_Language,
                m_SkipHidden,
                m_Delay,
                intervals,
                m_Cleanup,
                m_CleanupGrace,
                m_Debug,
                m_DebugEffect
                );

            //Dungeon Wilderness Guarded House Jail

            m_EncounterTimers = new EncounterTimer[m_Intervals.Length];

            if( m_Intervals.Length >= 3 )
            {
                m_EncounterTimers[0] = new EncounterTimer( "Dungeon", m_Intervals[0] );
                m_EncounterTimers[1] = new EncounterTimer( "Wilderness", m_Intervals[1] );
                m_EncounterTimers[2] = new EncounterTimer( "Guarded", m_Intervals[2] );
            }
            if ( m_Intervals.Length >= 4 )
            {
                //m_EncounterTimers[3] = new EncounterTimer( "House", m_Intervals[3] );
                Console.WriteLine("RE: WARNING, House Spawning not implemented yet.");
            }
            if ( m_Intervals.Length == 5 )
            {
                //m_EncounterTimers[4] = new EncounterTimer( "Jail", m_Intervals[4] );
                Console.WriteLine("RE: WARNING, Jail Spawning not implemented yet.");
            }

            foreach( EncounterTimer timer in m_EncounterTimers ) timer.Start();

            if( m_ReinitializeTimer==null )
            {
                m_ReinitializeTimer = new ReinitializeTimer();
                m_ReinitializeTimer.Start();
            }

//        if (cleanupList.Count>0)
//        {
//            DeleteEncounterTimer deleter = new DeleteEncounterTimer( m_Cleanup, cleanupList );
//            deleter.Start();
//        }

            m_DeleteTimer = new DeleteTimer( Cleanup, Cleanup );
            m_DeleteTimer.Start();
        }
        else
        {
            Console.WriteLine("##### RE: ***FAILED INITIALIZATION***!");
        }
    }