Exemple #1
0
        protected ATrail(
            int nCustomerID,
            long?cashRequestID,
            long?nlCashRequestID,
            DecisionStatus nDecisionStatus,
            ASafeLog oLog,
            string toExplanationEmailAddress,
            string fromEmailAddress,
            string fromEmailName
            )
        {
            this.m_bIsDecisionLocked = false;
            this.m_oDiffNotes        = new List <string>();
            this.m_oSteps            = new List <ATrace>();
            this.stepsWithDecision   = new List <StepWithDecision>();

            CustomerID      = nCustomerID;
            CashRequestID   = cashRequestID;
            NLCashRequestID = nlCashRequestID;

            this.m_nDecisionStatus            = nDecisionStatus;
            this.m_sToExplanationEmailAddress = toExplanationEmailAddress;
            this.m_sFromEmailAddress          = fromEmailAddress;
            this.m_sFromEmailName             = fromEmailName;
            this.m_oLog = oLog.Safe();

            this.timer        = new TimeCounter();
            HasApprovalChance = false;
        }         // constructor
Exemple #2
0
        }         // class SaveDecisionTrail

        private T Add <T>(DecisionStatus nDecisionStatus, bool bLockDecisionAfterAddingAStep) where T : ATrace
        {
            T oTrace = (T)Activator.CreateInstance(typeof(T), nDecisionStatus);

            this.m_oSteps.Add(oTrace);

            this.stepsWithDecision.Add(new StepWithDecision(oTrace, nDecisionStatus));

            if (!IsDecisionLocked)
            {
                UpdateDecision(nDecisionStatus);
            }

            if (bLockDecisionAfterAddingAStep)
            {
                LockDecision();
                oTrace.HasLockedDecision = true;
            }             // if

            // ReSharper disable PossibleNullReferenceException
            if (oTrace.GetType() == typeof(ExceptionThrown))
            {
                (oTrace as ExceptionThrown).OnAfterInitEvent += step => this.m_oDiffNotes.Add(step.Comment);
            }
            // ReSharper restore PossibleNullReferenceException

            return(oTrace);
        }         // Add
Exemple #3
0
 /// <summary>
 /// Checks whether the player has used their weapon and changes the decision status.
 /// </summary>
 private void CheckWeaponUsed(AIController owner)
 {
     if (true)
     {
         WeaponUsed = DecisionStatus.ShouldDecide;
     }
 }
Exemple #4
0
 /// <summary>
 /// Checks whether the NPC is injured changes the decision status.
 /// </summary>
 private void CheckNPCInjured(AIController owner)
 {
     if (true)
     {
         NPCInjured = DecisionStatus.ShouldDecide;
     }
 }
 protected override void UpdateDecision(DecisionStatus nDecisionStatus)
 {
     if (nDecisionStatus != DecisionStatus.Affirmative)
     {
         DecisionStatus = DecisionStatus.Negative;
     }
 } // UpdateDecision
Exemple #6
0
 private void CheckDecisionStatusIsSpecified(DecisionStatus status)
 {
     if (status == null)
     {
         throw new ArgumentException("A status must be specified.");
     }
 }
Exemple #7
0
 public EntityDecision UpdateStatus(DecisionStatus newStatus)
 {
     ExecuteSql(
         $@"UPDATE entity_decisions SET status = '{newStatus.ToString()}', updated_at = CURRENT_TIMESTAMP WHERE id = @id"
         , new { id }
         );
     return(this);
 }
Exemple #8
0
        protected override void UpdateDecision(DecisionStatus nDecisionStatus)
        {
            if (nDecisionStatus == DecisionStatus.Dunno)
            {
                return;
            }

            DecisionStatus = nDecisionStatus;
        } // UpdateDecision
        public static bool UpdateStatus(EntityDecision decision, DecisionStatus status)
        {
            if (decision.status == DecisionStatus.Canceled || decision.status == DecisionStatus.Closed)
            {
                return(false);
            }

            decision.UpdateStatus(status);
            return(true);
        }
Exemple #10
0
 internal Decision(Element element, string id, DateTime date, string title, DecisionStatus status, Format format, string content)
 {
     Element = element;
     Id      = id;
     Date    = date;
     Title   = title;
     Status  = status;
     Format  = format;
     Content = content;
 }
Exemple #11
0
    /// <summary>
    /// Is the NPC intimidated after being injured.
    /// </summary>
    private bool IsIntimidatedByInjury(AIController owner)
    {
        switch (NPCInjured)
        {
        case DecisionStatus.DidNotDecide:
            CheckNPCInjured(owner);
            return(false);

        case DecisionStatus.ShouldDecide:
            NPCInjured = DecisionStatus.DidDecide;
            return(MakeRandomDecision(50 + ((AISuspectController)owner).LevelOfTactics));

        case DecisionStatus.DidDecide:
            return(false);

        default:
            return(false);
        }
    }
Exemple #12
0
    /// <summary>
    /// Is the NPC intimidated by the weapon being used.
    /// </summary>
    private bool IsIntimidatedByWeaponUsage(AIController owner)
    {
        switch (WeaponUsed)
        {
        case DecisionStatus.DidNotDecide:
            CheckWeaponUsed(owner);
            return(false);

        case DecisionStatus.ShouldDecide:
            WeaponUsed = DecisionStatus.DidDecide;
            return(MakeRandomDecision(25 + ((AISuspectController)owner).LevelOfTactics));

        case DecisionStatus.DidDecide:
            return(false);

        default:
            return(false);
        }
    }
Exemple #13
0
    /// <summary>
    /// Is the NPC intimidated by the weapon being aimed at them.
    /// </summary>
    private bool IsIntimidatedByWeapon(AIController owner)
    {
        switch (WeaponAimed)
        {
        case DecisionStatus.DidNotDecide:
            CheckWeaponDrawn(owner);
            return(false);

        case DecisionStatus.ShouldDecide:
            WeaponAimed = DecisionStatus.DidDecide;
            return(MakeRandomDecision(100 - ((AISuspectController)owner).LevelOfAgression));

        case DecisionStatus.DidDecide:
            return(false);

        default:
            return(false);
        }
    }
Exemple #14
0
        public ISet <Decision> ImportArchitectureDecisionRecords(SoftwareSystem softwareSystem)
        {
            HashSet <Decision> decisions = new HashSet <Decision>();

            IEnumerable <FileInfo> markdownFiles = _path.GetFiles().Where(f => f.Name.EndsWith(".md"));

            // first create an index of filename -> ID
            Dictionary <string, string> index = new Dictionary <string, string>();

            foreach (FileInfo file in markdownFiles)
            {
                index.Add(file.Name, ExtractIntegerIdFromFileName(file));
            }

            foreach (FileInfo file in markdownFiles)
            {
                string         id      = ExtractIntegerIdFromFileName(file);
                DateTime       date    = new DateTime();
                string         title   = "";
                DecisionStatus status  = DecisionStatus.Proposed;
                string         content = File.ReadAllText(file.FullName, Encoding.UTF8);
                content = content.Replace("\r", "");
                Format format = Format.Markdown;

                title  = ExtractTitle(content);
                date   = ExtractDate(content);
                status = ExtractStatus(content);

                foreach (string filename in index.Keys)
                {
                    content = content.Replace(filename, CalculateUrl(softwareSystem, index[filename]));
                }

                Decision decision = _workspace.Documentation.AddDecision(softwareSystem, id, date, title, status, format, content);
                decisions.Add(decision);
            }

            return(decisions);
        }
Exemple #15
0
 public LRDIsTooOld(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }                                                                                      // constructor
 public BusinessScorePreventer(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }                                                                                                // constructor
Exemple #17
0
 protected AThresholdTrace(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
     Accuracy = 0;
 }         // constructor
Exemple #18
0
 public FraudSuspect(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor
Exemple #19
0
 public LastDecisionWasReject(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }                                                                                                // constructor
Exemple #20
0
 public Seniority(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }                                                                                    // constructor
Exemple #21
0
 public TodayLoans(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor
Exemple #22
0
 public Complete(DecisionStatus nDecisionStatus)
     : base(nDecisionStatus)
 {
 }                                          // constructor
Exemple #23
0
 public Charges(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor
Exemple #24
0
 public HmrcThreeMonthsTurnover(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor
Exemple #25
0
 public ConsumerDefaults(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }
Exemple #26
0
 public DefaultAccounts(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor
        }         // AllowMismatch

        public AnnualTurnoverPreventer(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
        {
        }                                                                                                 // constructor
Exemple #28
0
 public InitialAssignment(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
     ValidationErrors = new List <string>();
 }         // constructor
Exemple #29
0
		public LateLoans(DecisionStatus nDecisionStatus) : base(nDecisionStatus) {
		} // constructor
Exemple #30
0
 public HalfYearTurnover(DecisionStatus nDecisionStatus) : base(nDecisionStatus)
 {
 }         // constructor