예제 #1
0
 public void SetOptFlag(OptFlags toSet, bool value)
 {
     if (UseGlobal)
     {
         if (value)
         {
             m_GlobalFlags |= toSet;
         }
         else
         {
             m_GlobalFlags &= ~toSet;
         }
     }
     else
     {
         if (value)
         {
             m_Flags |= toSet;
         }
         else
         {
             m_Flags &= ~toSet;
         }
     }
 }
예제 #2
0
 public TravelAtlas(int flags) : base(0x22C5)
 {
     Movable  = true;
     LootType = LootType.Blessed;
     Hue      = 38;
     Name     = "Travel Atlas";
     Light    = LightType.Circle300;
     m_Flags  = (OptFlags)flags;
 }
예제 #3
0
 public static void SetOptFlag(ref OptFlags flags, OptFlags toSet, bool value)
 {
     if (value)
     {
         flags |= toSet;
     }
     else
     {
         flags &= ~toSet;
     }
 }
예제 #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_Flags       = (OptFlags)reader.ReadInt();
                m_GlobalFlags = (OptFlags)reader.ReadInt();
                break;
            }

            case 1:
            {
                SetOptFlag(ref m_Flags, OptFlags.IlshenarShrines, reader.ReadBool());
                goto case 0;
            }

            case 0:
            {
                SetOptFlag(ref m_Flags, OptFlags.Trammel, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.TramDungeons, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.Felucca, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.FelDungeons, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.Custom, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.Ilshenar, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.Malas, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.Tokuno, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.AllowReds, reader.ReadBool());
                SetOptFlag(ref m_Flags, OptFlags.TerMur, reader.ReadBool());
                UseGlobal = false;
                break;
            }
            }
        }
예제 #5
0
 public static bool GetOptFlag(OptFlags flags, OptFlags flag)
 {
     return((flags & flag) != 0);
 }
		public WorldOmniporter( int flags, bool moongate ) : base( moongate? 0xF6C : 7107 )
		{
			Movable = false;
			Hue = 38;
			Name = "World Omniporter";
			Light = LightType.Circle300;
			m_Flags = (OptFlags)flags;
			m_MobileUse = (Hashtable)GlobalMobileUse;
		}
		public static bool GetOptFlag( OptFlags flags, OptFlags flag )
		{
			return ( (flags & flag) != 0 );
		}
		public static void SetOptFlag( ref OptFlags flags, OptFlags toSet, bool value )
		{
			if ( value )
				flags |= toSet;
			else
				flags &= ~toSet;
		}
		public void SetOptFlag( OptFlags toSet, bool value )
		{
			if ( UseGlobal )
			{
				if ( value )
					m_GlobalFlags |= toSet;
				else
					m_GlobalFlags &= ~toSet;
			}
			else
			{
				if ( value )
					m_Flags |= toSet;
				else
					m_Flags &= ~toSet;
			}
		}
		private static bool loaded;  // Global variable: we load all uses at once.

		public override void Deserialize( GenericReader reader )
		{
			loaded = false;
			base.Deserialize( reader );

			int version = reader.ReadInt();
			
			switch( version )
			{
				case 3:
				{
					int outlength = m_Entries.Length;
					int inlength;
					
					loadTo = new int[outlength][];
					loadFrom = new int[outlength][];
					
					for ( int x=0; x<outlength; x++ )
					{
						inlength = reader.ReadInt();
						loadTo[x] = new int[inlength];
						loadFrom[x] = new int[inlength];
						
						for ( int y=0; y<loadTo[x].Length; y++ )
						{
							loadTo[x][y] = reader.ReadInt();
							loadFrom[x][y] = reader.ReadInt();
						}
					}
					goto case 2;
				}
				case 2:
				{
					m_LocalUses = reader.ReadInt();
					goto case 1;
				}
				case 1: 
				{
					m_GlobalBasePrice = reader.ReadInt();
					m_BasePrice = reader.ReadInt();
					m_GlobalSkillsCostBonus = reader.ReadInt();
					m_SkillsCostBonus = reader.ReadInt();
					m_GlobalKarmaDiscountBonus = reader.ReadInt();
					m_KarmaDiscountBonus = reader.ReadInt();
					m_GlobalTimeExpiration = TimeSpan.FromSeconds( reader.ReadInt() );
					m_TimeExpiration = TimeSpan.FromSeconds( reader.ReadInt() );
					m_GlobalMaxUses = reader.ReadInt();
					m_MaxUses = reader.ReadInt();
					m_GlobalTimeDelay = TimeSpan.FromSeconds( reader.ReadInt() );
					m_TimeDelay = TimeSpan.FromSeconds( reader.ReadInt() );
					GlobalMobileUse = new Hashtable();
					m_MobileUse = new Hashtable();
					try { GlobalMobileUse.Add( "0", new UseEntry( "None", 0, DateTime.Now ) ); }
					catch { Console.WriteLine("Exception caught Deserializing GlobalMobileUse."); }
					m_MobileUse.Add( "0", new UseEntry( "None", 0, DateTime.Now ) );
					goto case 0;
				}
				case 0:
				{
					m_Flags = (OptFlags)reader.ReadInt();
					m_GlobalFlags = (OptFlags)reader.ReadInt();
					break;
				}
			}
		}
예제 #11
0
        public static LLVMPassManagerRef CreatePassManager(LLVMModuleRef module, OptFlags flags)
        {
            var pass = module.CreateFunctionPassManager();

            if ((flags & OptFlags.Reassociate) != 0)
            {
                pass.AddReassociatePass();
            }

            if ((flags & OptFlags.Vectorize) != 0)
            {
                pass.AddLoopVectorizePass();
            }

            if ((flags & OptFlags.CombineInstructions) != 0)
            {
                pass.AddInstructionCombiningPass();
            }

            if ((flags & OptFlags.RotateLoops) != 0)
            {
                pass.AddLoopRotatePass();
            }

            if ((flags & OptFlags.UnrollLoops) != 0)
            {
                pass.AddLoopUnrollPass();
            }

            if ((flags & OptFlags.UnswitchLoops) != 0)
            {
                pass.AddLoopUnswitchPass();
            }

            if ((flags & OptFlags.CanonicalizeInductionVariables) != 0)
            {
                pass.AddIndVarSimplifyPass();
            }

            if ((flags & OptFlags.DeleteUnusedLoops) != 0)
            {
                pass.AddLoopDeletionPass();
            }

            if ((flags & OptFlags.GlobalValueNumbering) != 0)
            {
                pass.AddNewGVNPass();
            }

            if ((flags & OptFlags.OptimizeMemCpy) != 0)
            {
                pass.AddMemCpyOptPass();
            }

            if ((flags & OptFlags.SimplifyControlFlowGraph) != 0)
            {
                pass.AddCFGSimplificationPass();
            }

            pass.InitializeFunctionPassManager();
            return(pass);
        }