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
} // 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
/// <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; } }
/// <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
private void CheckDecisionStatusIsSpecified(DecisionStatus status) { if (status == null) { throw new ArgumentException("A status must be specified."); } }
public EntityDecision UpdateStatus(DecisionStatus newStatus) { ExecuteSql( $@"UPDATE entity_decisions SET status = '{newStatus.ToString()}', updated_at = CURRENT_TIMESTAMP WHERE id = @id" , new { id } ); return(this); }
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); }
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; }
/// <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); } }
/// <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); } }
/// <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); } }
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); }
public LRDIsTooOld(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public BusinessScorePreventer(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
protected AThresholdTrace(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { Accuracy = 0; } // constructor
public FraudSuspect(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public LastDecisionWasReject(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public Seniority(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public TodayLoans(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public Complete(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public Charges(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public HmrcThreeMonthsTurnover(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public ConsumerDefaults(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { }
public DefaultAccounts(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
} // AllowMismatch public AnnualTurnoverPreventer(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public InitialAssignment(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { ValidationErrors = new List <string>(); } // constructor
public LateLoans(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor
public HalfYearTurnover(DecisionStatus nDecisionStatus) : base(nDecisionStatus) { } // constructor