示例#1
0
        public override void CheckCompatibility(ref MisAction existing)
        {
            if (Units == null || UnitMission == null)
            {
                if (!existing.Action.IsReinforcement())
                {
                    throw new InvalidOperationException("The original action is incompatible ({0}) with a reinforcement action. A full modification is required.".F(existing.Action));
                }
            }

            if (Position == null)
            {
                if (!existing.Action.RequiresPosition())
                {
                    throw new InvalidOperationException("The original action ({0}) did not have a position defined. A position must be specified.".F(existing.Action));
                }
            }

            if (House == null)
            {
                if (!existing.Action.RequiresHouse())
                {
                    throw new InvalidOperationException("The original action ({0}) did not have a house defined. A house must be specified.".F(existing.Action));
                }
            }
        }
示例#2
0
 public override void CheckCompatibility(ref MisAction existing)
 {
     // If the only parameter is empty, something is wrong
     if (Time == null)
     {
         throw new InvalidOperationException("The time must be specified.");
     }
 }
 public override void CheckCompatibility(ref MisAction existing)
 {
     if (House == null)
     {
         if (!existing.Action.RequiresHouse())
         {
             throw new InvalidOperationException("The original action ({0}) did not have a house defined. A house must be specified.".F(existing.Action));
         }
     }
 }
示例#4
0
 public override void CheckCompatibility(ref MisAction existing)
 {
     if (MessageID == null)
     {
         if (existing.Action != EventType.SHOWMESSAGE)
         {
             throw new InvalidOperationException("The original action ({0}) was not a message action. The message ID must be specified.".F(existing.Action));
         }
     }
 }
 public override void CheckCompatibility(ref MisAction existing)
 {
     // If the only parameter is empty, something is wrong
     if (Flag == null || Enable == null)
     {
         if (existing.Action != EventType.SETFLAG)
         {
             throw new InvalidOperationException("The original action ({0}) was not a flag action. The flag and enable must be specified.".F(existing.Action));
         }
     }
 }
示例#6
0
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = EventType.HIDETIMER,
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse
            };
        }
示例#7
0
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = MissionStateExt.ToActionType(State),
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
            };
        }
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = AttributeTypeExt.ToActionType(Type),
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                House = House ?? old.House,
                Value = Value ?? old.Value
            };
        }
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = EventType.SETFLAG,
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                Flag   = Flag ?? old.Flag,
                Enable = Enable ?? old.Enable
            };
        }
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = EventType.REVEAL,
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                Position             = Position ?? old.Position,
                RevealMapRadius      = Radius ?? old.RevealMapRadius
            };
        }
示例#11
0
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = EventType.SHOWMESSAGE,
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                MessageID            = MessageID ?? old.MessageID,
                Value = MessageUnknown
            };
        }
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = EventType.ALLEGIANCE,
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                House       = House ?? old.House,
                TargetHouse = TargetHouse ?? old.TargetHouse,
                Allegiance  = DiplomaticState ?? old.Allegiance
            };
        }
示例#13
0
        public override void Write(ref MisAction action)
        {
            // Make copy (could submit it to a undo/redo state machine for undo measure...)
            MisAction old = action;

            action = new MisAction
            {
                Action               = ReinforcementTypeExt.ToActionType(Type),
                Conditions           = old.Conditions,
                ConditionFireIfFalse = old.ConditionFireIfFalse,
                Position             = Position ?? old.Position,
                House         = House ?? old.House,
                NumberOfUnits = (byte)(Units ?? old.Units).Length,
                Units         = Units ?? old.Units,
                UnitMission   = UnitMission ?? old.UnitMission
            };
        }
        public override void CheckCompatibility(ref MisAction existing)
        {
            if (Position == null)
            {
                if (!existing.Action.RequiresPosition())
                {
                    throw new InvalidOperationException("The original action ({0}) did not have a position defined. A position must be specified.".F(existing.Action));
                }
            }

            if (Radius == null)
            {
                if (existing.Action != EventType.REVEAL)
                {
                    throw new InvalidOperationException("The original action ({0}) was not a map reveal action. The reveal radius must be specified.".F(existing.Action));
                }
            }
        }
        public override void CheckCompatibility(ref MisAction existing)
        {
            if (House == null)
            {
                if (!existing.Action.RequiresHouse())
                {
                    throw new InvalidOperationException("The original action ({0}) did not have a house defined. A house must be specified.".F(existing.Action));
                }
            }

            if (TargetHouse == null || DiplomaticState == null)
            {
                if (existing.Action != EventType.ALLEGIANCE)
                {
                    throw new InvalidOperationException("The original action ({0}) was not a diplomacy action. The target house and diplomatic state must be specified.".F(existing.Action));
                }
            }
        }
示例#16
0
 public virtual void CheckCompatibility(ref MisAction existing)
 {
 }
示例#17
0
 public abstract void Write(ref MisAction action);