Esempio n. 1
0
 public Script Copy(string appendix)
 {
     return new Script()
     {
         ActionsComment = ActionsComment,
         ActionsFireSequentially = ActionsFireSequentially,
         ActionsIfFalse = ActionsIfFalse.Select(a => a.Copy(appendix)).ToArray(),
         ActionsIfTrue = ActionsIfTrue.Select(a => a.Copy(appendix)).ToArray(),
         ActiveInEasy = ActiveInEasy,
         ActiveInHard = ActiveInHard,
         ActiveInMedium = ActiveInMedium,
         Comment = Comment,
         ConditionsComment = ConditionsComment,
         DeactivateUponSuccess = DeactivateUponSuccess,
         EvaluationInterval = EvaluationInterval,
         EvaluationIntervalType = EvaluationIntervalType,
         IsActive = IsActive,
         IsSubroutine = IsSubroutine,
         LoopActions = LoopActions,
         LoopCount = LoopCount,
         Name = Name + appendix,
         OrConditions = OrConditions.Select(c => c.Copy(appendix)).ToArray(),
         SequentialTargetName = SequentialTargetName, // TODO: appendix?
         SequentialTargetType = SequentialTargetType,
         Unknown = Unknown,
         Unknown2 = Unknown2,
         Unknown3 = Unknown3,
         UsesEvaluationIntervalType = UsesEvaluationIntervalType,
     };
 }
Esempio n. 2
0
 public override int GetSize(bool includingHeader)
 {
     return(base.GetSize(includingHeader)
            + 2
            + Comment.Length
            + 2
            + ConditionComment.Length
            + 2
            + ActionComment.Length
            + 4 * 1
            + 4
            + OrConditions.Sum(o => o.GetSize(true))
            + ActionsIfTrue.Sum(a => a.GetSize(true))
            + ActionsIfFalse.Sum(a => a.GetSize(true)));
 }