Beispiel #1
0
 internal void Add(Decision decision)
 {
     if (decision != null)
     {
         Decisions.Add(decision);
     }
 }
Beispiel #2
0
 public StepDecision(Decision decision, WorkflowState wfState = null)
     : this()
 {
     if (decision != null)
     {
         Decisions.Add(decision);
     }
     WfState = wfState;
 }
Beispiel #3
0
        public Game()
        {
            AddParameter(new Parameter(ParameterIds.HappinessSensitivity, "Happiness Sensitivity", 0.25, 0, 1));  // How quickly happiness follows Satisfaction, 0: never, 1: immediately

            Date = new Date(2013, 1, 1);

            ProductTypes.Add(new ProductType("Food", 0.5, 1));
            ProductTypes.Add(new ProductType("Clothes", 1, 1));

            Country = new Polity.Country(StartPopulation);

            Event e = new Event("Discovery");

            e.Condition = new ChanceCondition(0.01);
            e.Effect    = new MultipleEffects();
            e.AddEffect(new MessageEffect("New technologies increase productivity!"));
            e.AddEffect(new ChangeParameterEffect(Country, ParameterIds.Productivity, 1, 0.05));

            e             = new Event("MPs Propose to Lower Taxes");
            e.Condition   = new ChanceCondition(0.3);
            e.HappensOnce = true;
            Issues iss = new Issues();

            iss.AddIssue(IssueIds.Populism, 1);
            iss.AddIssue(IssueIds.BigGovernment, -1);
            e.Effect = new SubmitBillEffect(new Bill(iss, new ChangeParameterEffect(Country, ParameterIds.IncomeTaxRate, 1, -0.05)), Country.Parliament);
            Events.Add(e);

            Decision d = new Decision("Celebrate");

            d.DisplayCondition = new HasMoneyCondition(Country.Budget, 5);
            d.Effect           = new MessageEffect("We have lots of money! Hurray!");
            Decisions.Add(d);

            d   = new Decision("Decrease Income Tax");
            iss = new Issues();
            iss.AddIssue(IssueIds.Populism, 0.5);
            iss.AddIssue(IssueIds.BigGovernment, -0.5);
            d.Effect = new SubmitBillEffect(new Bill(iss, new ChangeParameterEffect(Country, ParameterIds.IncomeTaxRate, 1, -0.02)), Country.Parliament);
            Decisions.Add(d);

            d   = new Decision("Increase Income Tax");
            iss = new Issues();
            iss.AddIssue(IssueIds.Populism, -0.5);
            iss.AddIssue(IssueIds.BigGovernment, 0.5);
            d.Effect = new SubmitBillEffect(new Bill(iss, new ChangeParameterEffect(Country, ParameterIds.IncomeTaxRate, 1, 0.02)), Country.Parliament);
            Decisions.Add(d);

            d = new Decision("See Invisible Pink Unicorn");
            d.DisplayCondition = new ConstCondition(false);
            d.Effect           = new MessageEffect("Wow! Here it is: the invisible pink unicorn");
            Decisions.Add(d);
        }
Beispiel #4
0
        private void LoadDecisions()
        {
            Decisions.Clear();
            foreach (var decision in GetDecisionsForTopic())
            {
                Decisions.Add(Decision.Load(decision, false));
            }
            var temp = Utils.SortDecisionsByState(Decisions.ToList());

            Decisions = new BindingList <IDecision>(temp);
            Decisions.RaiseListChangedEvents = true;
            Decisions.ListChanged           += ListMemberChanged;
        }
Beispiel #5
0
        public Decision AddDecision(SoftwareSystem softwareSystem, string id, DateTime date, string title, DecisionStatus status, Format format, string content)
        {
            CheckIdIsSpecified(id);
            CheckTitleIsSpecified(title);
            CheckContentIsSpecified(content);
            CheckDecisionStatusIsSpecified(status);
            CheckFormatIsSpecified(format);
            CheckDecisionIsUnique(softwareSystem, id);

            Decision decision = new Decision(softwareSystem, id, date, title, status, format, content);

            Decisions.Add(decision);

            return(decision);
        }
Beispiel #6
0
 /// <summary>
 /// Add a decision to the list of decisions that the human needs to make
 /// </summary>
 public void AddDecision(Decision decision)
 {
     Decisions.Add(decision);
     RefreshBannedSubjectsList();
 }