示例#1
0
 public override void CheckCompatibility(ref MisCondition existing)
 {
     if (Position == null)
     {
         if (!existing.Condition.RequiresPosition())
         {
             throw new InvalidOperationException("The original condition ({0}) did not have a position defined. A position must be specified.".F(existing.Condition));
         }
     }
 }
示例#2
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            //MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.FLAG,
            };
        }
示例#3
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.HARVESTED,
                Value     = Value ?? old.Value,
            };
        }
示例#4
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.UNITEXISTS,
                House     = House ?? old.House,
                Unit      = Unit ?? old.Unit,
            };
        }
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.TIMER,
                Compare   = Compare ?? old.Compare,
                Time      = Time ?? old.Time
            };
        }
示例#6
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.REVEALED,
                Position  = Position ?? old.Position,
                Value     = Unknown,
            };
        }
示例#7
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ObjectTypeExt.ToConditionType(State),
                House     = House ?? old.House,
                Value     = Unknown,
            };
        }
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.BUILDINGEXISTS,
                House     = House ?? old.House,
                Building  = Building ?? old.Building,
            };
        }
示例#9
0
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition = ConditionType.UNITEXISTS,
                House     = House ?? old.House,
                Value     = Minimum ?? old.Value,
                Ratio     = Ratio ?? old.Ratio
            };
        }
        public override void Write(ref MisCondition condition)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisCondition old = condition;

            condition = new MisCondition
            {
                Condition    = ConditionType.TIMER,
                InitialDelay = InitialDelay ?? old.InitialDelay,
                Time         = Time ?? old.Time,
                Value        = RunCount ?? old.Value
            };
        }
示例#11
0
        public override void CheckCompatibility(ref MisCondition existing)
        {
            //if (State == null)
            //  if (existing.Condition != ConditionTypeEnum.NO_BUILDINGS_LEFT && existing.Condition != ConditionTypeEnum.NO_UNITS_LEFT)
            //    throw new InvalidOperationException("The original condition ({0}) was not a no more objects condition. The object type must be specified.".F(existing.Condition));

            if (House == null)
            {
                if (!existing.Condition.RequiresHouse())
                {
                    throw new InvalidOperationException("The original condition ({0}) did not have a house defined. A house must be specified.".F(existing.Condition));
                }
            }
        }
示例#12
0
        public override void CheckCompatibility(ref MisCondition existing)
        {
            if (Unit == null)
            {
                if (existing.Condition != ConditionType.UNITEXISTS)
                {
                    throw new InvalidOperationException("The original condition ({0}) was not a unit exist condition. The unit must be specified.".F(existing.Condition));
                }
            }

            if (House == null)
            {
                if (!existing.Condition.RequiresHouse())
                {
                    throw new InvalidOperationException("The original condition ({0}) did not have a house defined. A house must be specified.".F(existing.Condition));
                }
            }
        }
        public override void CheckCompatibility(ref MisCondition existing)
        {
            if (Compare == null)
            {
                if (existing.Condition != ConditionType.TIMER)
                {
                    throw new InvalidOperationException("The original condition ({0}) was not a timer condition. The comparer must be specified.".F(existing.Condition));
                }
            }

            if (Time == null)
            {
                if (!existing.Condition.RequiresTime())
                {
                    throw new InvalidOperationException("The original condition ({0}) did not have a time defined. A time must be specified.".F(existing.Condition));
                }
            }
        }
        public override void CheckCompatibility(ref MisCondition existing)
        {
            if (InitialDelay == null || RunCount == null)
            {
                if (existing.Condition != ConditionType.INTERVAL)
                {
                    throw new InvalidOperationException("The original condition ({0}) was not an interval condition. The initial delay and run count must be specified.".F(existing.Condition));
                }
            }

            if (Time == null)
            {
                if (!existing.Condition.RequiresTime())
                {
                    throw new InvalidOperationException("The original condition ({0}) did not have a time defined. A time must be specified.".F(existing.Condition));
                }
            }
        }
示例#15
0
        public override void CheckCompatibility(ref MisCondition existing)
        {
            if (Ratio == null || Minimum == null)
            {
                if (existing.Condition != ConditionType.CASUALTIES)
                {
                    throw new InvalidOperationException("The original condition ({0}) was not a casuality condition. The minimum loss and ratio must be specified.".F(existing.Condition));
                }
            }

            if (House == null)
            {
                if (!existing.Condition.RequiresHouse())
                {
                    throw new InvalidOperationException("The original condition ({0}) did not have a house defined. A house must be specified.".F(existing.Condition));
                }
            }
        }
示例#16
0
 public abstract void Write(ref MisCondition action);
示例#17
0
 public virtual void CheckCompatibility(ref MisCondition existing)
 {
 }