Exemple #1
0
 public LineDefCrusherType(Trigger trigger, Repeatable repeatable, Speed speed, MonsterActivate monsterActivate, Silent silent, CrusherAction action) : base(Category.Crusher)
 {
     this.trigger         = trigger;
     this.repeatable      = repeatable;
     this.speed           = speed;
     this.monsterActivate = monsterActivate;
     this.silent          = silent;
     this.action          = action;
 }
Exemple #2
0
        private static string ConcatStrings(string normalParameter, Repeatable <string> repeatable)
        {
            if (repeatable == null)
            {
                return(normalParameter);
            }

            return(repeatable.Aggregate(normalParameter, (current, str) => current + str));
        }
Exemple #3
0
 public LineDefDoorType(Trigger trigger, Repeatable repeatable, Lock lockType, Speed speed, int wait, MonsterActivate monsterActivate, DoorAction doorAction) : base(Category.Door)
 {
     this.trigger         = trigger;
     this.repeatable      = repeatable;
     this.lockType        = lockType;
     this.speed           = speed;
     this.wait            = wait;
     this.monsterActivate = monsterActivate;
     this.doorAction      = doorAction;
 }
Exemple #4
0
 public LineDefLiftType(Trigger trigger, Repeatable repeatable, int wait, Speed speed, TextureChange textureChange, Model model, MonsterActivate monsterActivate, LiftTarget target) : base(Category.Lift)
 {
     this.trigger         = trigger;
     this.repeatable      = repeatable;
     this.speed           = speed;
     this.textureChange   = textureChange;
     this.model           = model;
     this.monsterActivate = monsterActivate;
     this.target          = target;
 }
Exemple #5
0
        public void TestRepeatedGet()
        {
            int[]            testInput  = new[] { 1, 2, 3 };
            Repeatable <int> repeatable = testInput;

            // 1. Try
            CollectionAssert.AreEqual(testInput, repeatable);

            // 2. Try
            CollectionAssert.AreEqual(testInput, repeatable);
        }
Exemple #6
0
 public LineDefFloorType(Trigger trigger, Repeatable repeatable, Direction direction, Speed speed, TextureChange textureChange, Model model, MonsterActivate monsterActivate, Crush crush, FloorTarget target) : base(Category.Floor)
 {
     this.trigger         = trigger;
     this.repeatable      = repeatable;
     this.direction       = direction;
     this.speed           = speed;
     this.textureChange   = textureChange;
     this.model           = model;
     this.monsterActivate = monsterActivate;
     this.crush           = crush;
     this.target          = target;
 }
Exemple #7
0
        public void TestModifiedSource()
        {
            int[]            testInput  = new[] { 1, 2, 3 };
            var              testList   = new List <int>(testInput);
            Repeatable <int> repeatable = testList;

            // Normal access.
            CollectionAssert.AreEqual(testInput, repeatable);

            // Modified list.
            testList.RemoveAt(0);
            CollectionAssert.AreEqual(testInput, repeatable);
        }
Exemple #8
0
        private System.Object underlyingObject;    // The underlying HAPI object

        /// <summary>Constructor for FiniteList</summary>
        /// <param name="repType">the Class which is repeating
        /// </param>
        /// <param name="underlyingObject">the underlying object that the extending class represents
        /// </param>
        public FiniteList(System.Type repType, System.Object underlyingObject)
        {
            this.repType          = repType;
            this.underlyingObject = underlyingObject;

            Repeatable firstRep = createRep(0);

            this.maxReps = firstRep.MaxReps;
            this.minReps = firstRep.MinReps;

            reps = new System.Collections.ArrayList();
            reps.Add(firstRep);
            createNewReps(maxReps);
        }
Exemple #9
0
 public Job(JobType type, Repeatable repeateJob, int frequency, float price, string notes)
 {
     Type       = type;
     RepeateJob = repeateJob;
     if (RepeateJob == Repeatable.Yes)
     {
         Frequency = frequency;
     }
     else
     {
         Frequency = 0;
     }
     Price = price;
     Notes = notes;
 }
Exemple #10
0
 /// <summary>Creates the repition</summary>
 /// <param name="rep">the number representing which repition
 /// </param>
 private Repeatable createRep(int rep)
 {
     try
     {
         System.Reflection.ConstructorInfo theCon = repType.GetConstructors()[0];
         Repeatable thisRep = (Repeatable)theCon.Invoke(new System.Object[] { underlyingObject, (System.Int32)rep });
         return(thisRep);
     }
     catch (System.Reflection.TargetInvocationException e)
     {
         throw new ConformanceError("Error creating underlying repetition. This is a bug.\nError is: " + e.ToString() + "\n" + e.InnerException.Message);
     }
     catch (System.Exception e)
     {
         throw new ConformanceError("Error creating underlying repetition. This is a bug. Error is: " + e.ToString());
     }
 }
        private static string ConcatStrings(string normalParameter, Repeatable<string> repeatable)
        {
            if (repeatable == null)
            {
                return normalParameter;
            }

            return repeatable.Aggregate(normalParameter, (current, str) => current + str);
        }