SetFlags() public méthode

public SetFlags ( int value ) : void
value int
Résultat void
Exemple #1
0
        /// <summary>
        /// Examine a variable and set the flags.
        /// </summary>
        public static HITResult Test(HITThread thread)
        {
            var value = thread.ReadVar(thread.ReadByte());

            thread.SetFlags(value);

            return(HITResult.CONTINUE);
        }
Exemple #2
0
        /// <summary>
        /// Write a 4-byte constant to a variable.
        /// </summary>
        public static HITResult LoadL(HITThread thread)
        {
            var dest  = thread.ReadByte();
            var value = thread.ReadInt32();

            thread.WriteVar(dest, value);
            thread.SetFlags(value);

            return(HITResult.CONTINUE);
        }
Exemple #3
0
        /// <summary>
        /// Copy the contents of one variable into another.
        /// </summary>
        public static HITResult Set(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src  = thread.ReadVar(thread.ReadByte());

            thread.WriteVar(dest, src);

            thread.SetFlags(src);

            return(HITResult.CONTINUE);
        }
Exemple #4
0
        /// <summary>
        /// Compare two variables and set the flags.
        /// </summary>
        public static HITResult Cmp(HITThread thread) //same as sub, but does not set afterwards.
        {
            var dest = thread.ReadByte();
            var src  = thread.ReadByte();

            var result = thread.ReadVar(dest) - thread.ReadVar(src);

            thread.SetFlags(result);

            return(HITResult.CONTINUE);
        }
Exemple #5
0
        /// <summary>
        /// Find the lower of a "dest" variable and a "src" constant and store the result in the variable.
        /// </summary>
        public static HITResult Min(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src  = thread.ReadInt32();

            var result = Math.Min(thread.ReadVar(dest), src);

            thread.WriteVar(dest, result);

            thread.SetFlags(result);
            return(HITResult.CONTINUE); //unused in the sims
        }
Exemple #6
0
        //0x10
        /// <summary>
        /// Increment a "dest" variable by a "src" variable.
        /// </summary>
        public static HITResult Add(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src = thread.ReadByte();

            var result = thread.ReadVar(dest) + thread.ReadVar(src);
            thread.WriteVar(dest, result);

            thread.SetFlags(result);

            return HITResult.CONTINUE;
        }
Exemple #7
0
        /// <summary>
        /// Multiply a "dest" variable by a "src" variable.
        /// </summary>
        public static HITResult Mul(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src  = thread.ReadByte();

            var result = thread.ReadVar(dest) * thread.ReadVar(src);

            thread.WriteVar(dest, result);

            thread.SetFlags(result);

            return(HITResult.CONTINUE);
        }
Exemple #8
0
        /// <summary>
        /// Generate a random number between "low" and "high" variables, inclusive,
        /// and store the result in the "dest" variable.
        /// </summary>
        public static HITResult Rand(HITThread thread)
        {
            var dest = thread.ReadByte();
            var low  = thread.ReadByte();
            var high = thread.ReadByte();

            var result = (new Random()).Next(high + 1 - low) + low;

            thread.WriteVar(dest, result);

            thread.SetFlags(result);

            return(HITResult.CONTINUE);
        }
Exemple #9
0
        public static HITResult GetSrcDataField(HITThread thread)
        {
            var dest  = thread.ReadByte();
            var src   = thread.ReadByte();
            var field = thread.ReadByte();

            int ObjectVar = thread.ReadVar(src);

            ObjectVar = thread.ReadVar(10010 + ObjectVar);
            thread.WriteVar(dest, ObjectVar);
            thread.SetFlags(ObjectVar);

            return(HITResult.CONTINUE);
        }
Exemple #10
0
        /// <summary>
        /// Examine a variable and set the flags.
        /// </summary>
        public static HITResult Test(HITThread thread)
        {
            var value = thread.ReadVar(thread.ReadByte());

            thread.SetFlags(value);

            return HITResult.CONTINUE;
        }
Exemple #11
0
        /// <summary>
        /// Copy the contents of one variable into another.
        /// </summary>
        public static HITResult Set(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src = thread.ReadVar(thread.ReadByte());

            thread.WriteVar(dest, src);

            thread.SetFlags(src);

            return HITResult.CONTINUE;
        }
Exemple #12
0
        /// <summary>
        /// Generate a random number between "low" and "high" variables, inclusive, 
        /// and store the result in the "dest" variable.
        /// </summary>
        public static HITResult Rand(HITThread thread)
        {
            var dest = thread.ReadByte();
            var low = thread.ReadByte();
            var high = thread.ReadByte();

            var result = (new Random()).Next(high+1-low)+low;
            thread.WriteVar(dest, result);

            thread.SetFlags(result);

            return HITResult.CONTINUE;
        }
Exemple #13
0
        /// <summary>
        /// Find the lower of a "dest" variable and a "src" constant and store the result in the variable.
        /// </summary>
        public static HITResult Min(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src = thread.ReadInt32();

            var result = Math.Min(thread.ReadVar(dest), src);
            thread.WriteVar(dest, result);

            thread.SetFlags(result);
            return HITResult.CONTINUE; //unused in the sims
        }
Exemple #14
0
        /// <summary>
        /// Write a 4-byte constant to a variable.
        /// </summary>
        public static HITResult LoadL(HITThread thread)
        {
            var dest = thread.ReadByte();
            var value = thread.ReadInt32();

            thread.WriteVar(dest, value);
            thread.SetFlags(value);

            return HITResult.CONTINUE;
        }
Exemple #15
0
        public static HITResult GetSrcDataField(HITThread thread)
        {
            var dest = thread.ReadByte();
            var src = thread.ReadByte();
            var field = thread.ReadByte();

            int ObjectVar = thread.ReadVar(src);
            ObjectVar = thread.ReadVar(10010 + ObjectVar);
            thread.WriteVar(dest, ObjectVar);
            thread.SetFlags(ObjectVar);

            return HITResult.CONTINUE;
        }