Exemplo n.º 1
0
 public void logVote(VoteIssue issue)
 {
     if (World.logging)
     {
         string line = "  " + issue.ToString() + " for soc " + issue.society.getName();
         log.takeLine(line);
         foreach (VoteOption opt in issue.options)
         {
             line  = "     " + opt.fixedLenInfo();
             line += " U " + Eleven.toFixedLen(issue.computeUtility(this, opt, new List <ReasonMsg>()), 12);
             log.takeLine(line);
         }
     }
 }
        public void setTo(VoteIssue vi, VoteOption vo, Person p)
        {
            titleText.text = "For " + vo.info(vi);

            List <ReasonMsg> rs    = new List <ReasonMsg>();
            double           total = vi.computeUtility(p, vo, rs);

            string t = "";

            foreach (ReasonMsg r in rs)
            {
                t += "Influenced (" + r.value.ToString("N0") + ") by\n" + r.msg + "\n\n";
            }

            t            += "\nTotal Desirability: " + total.ToString("N0");
            mainText.text = t;
        }
Exemplo n.º 3
0
        public void SetInfo(VoteIssue i, VoteOption v, Person p)
        {
            foreground.sprite  = votesIcon;
            foreground.enabled = false;
            midground.enabled  = false;
            background.enabled = false;

            name.text = "";
            info.text = "";

            name2.text = "For " + v.info(i, true);
            info2.text = v.votingWeight.ToString("N0") + " influence across " + v.votesFor.Count + " votes";

            if (p != null)
            {
                // FIXME: use the list of reasons somewhere
                double utility = i.computeUtility(p, v, new List <ReasonMsg>());
                info2.text += "\n" + p.getFullName() + " values at " + utility.ToString("N0");
            }
        }